如何将这条匿名函数定义链重写为单独的函数,使其更易于维护和阅读?谢谢!
function animation(){
var timeout;
timeout=timeoutsetTimeout(function(){
console.log('step1')
timeout=setTimeout(function(){
console.log('step2')
timeout=setTimeout(function(){
console.log('almost there')
setTimeout(function(){
console.log('grand finale')
}, 300);
}, 1000);
}, 2000);
}, 5300);
}