JavaScript forEach() method compared to a for loop for both an array and node list

preview_player
Показать описание
This short screencast demonstrates how to use the forEach() method to apply a function to each item in an array using both arrow function and function keyword syntax. It also compares the forEach() method to a traditional for loop.
Then, the forEach() method is applied to a nodelist of img elements as returned by the querySelectorAll() method. The getElementsByTagName() method, which returns and HTML collection is also discussed.
Thank you for viewing! Happy Coding!
Рекомендации по теме
welcome to shbcf.ru