Using setTimeout() in JavaScript / Traffic Light Example

preview_player
Показать описание
A look at what JavaScript's setTimeout() function does, and how it's used, and how we can use it to animate the traffic light page that we created in the first video of the playlist.

I've also written a blog on using arrays instead of if for "selection":

Finally, here's an example traffic light that uses a slightly different approach to selecting the colours for the lights:
Рекомендации по теме