"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > Day / Days of Code: Advanced Loops

Day / Days of Code: Advanced Loops

Published on 2024-11-08
Browse:546

Day /  Days of Code: Advanced Loops

Fri, August 30, 2024

I’m currently in the second course of the Codecademy Full-Stack Engineer path. I recently completed the JavaScript Syntax I lesson and have finished the Arrays and Loops assignments in JavaScript Syntax II. Next up are Objects, Iterators, Errors and Debugging, Practice, and three Challenge Projects.

The main highlight today was learning about loops that were completely new to me, namely for..of and for..in loops. These work much like traditional for loops but are more concise, readable, and maintainable. Here’s a comparison:

// Traditional for loop
for (let i = 0; i 



In for..of loops, iterators are completely abstracted, bringing the objects and elements themselves to the forefront. This shift in focus makes the code more readable. However, these are not complete replacements for traditional for loops, e.g.: they don’t support backward iteration, although break and continue statements are available.

Overall, I’m enjoying the journey and looking forward to the challenges ahead. The 100 Days of Code challenge has been not only a great way to stay motivated and track my progress, but the Dev community is awesome!

Release Statement This article is reproduced at: https://dev.to/jacobsternx/day-61-100-days-of-code-advanced-loops-ljb?1 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3