here is my code for the sequence animation project.
I am waiting for your assessment.
here is my code for the sequence animation project.
Hi @iidlex99
In your solution with setTimeout()
the start of the next animations depends on a specific timing, but the exercise asks to start the next animation when the last ends. This can be achieved with Animation.finished.
There are three different versions offered:
We’d like you to try a few different ways to implement this, to reinforce different ways of using promises.
- First, implement something that works, but has the promise version of the “callback hell” problem we saw in our discussion of using callbacks.
- Next, implement it as a promise chain. Note that there are a few different ways you can write this, because of the different forms you can use for an arrow function. Try some different forms. Which is the most concise? Which do you find the most readable?
- Finally, implement it using
async
andawait
.
Michael
Thanks for your feedback how about this? https://codepen.io/abdisalam-abdulahi/pen/OJvqWxb
Great improvements, @iidlex99!
You have correctly solved the exercise. I also think using async/await is the most elegant way to do it.