Loading...
「ツール」は右上に移動しました。
利用したサーバー: wtserver2
11いいね 313回再生

forEach vs Map in JavaScript?!

Are you confused about the difference between the map and forEach methods in JavaScript? In this video, I explain the distinction between the two and provide examples of when to use each one. Join me as we dive into the world of array methods and learn how to manipulate data efficiently. Don't forget to subscribe for more informative content like this!
Are you trying to learn JavaScript?! You've come to the right place! Code Emily is all about JavaScript Tutorials, helping you get off the ground, tips for being a dev and more. Let's learn Javascript in 2023 together!

JavaScript forEach video:    • JavaScript forEach (in 1.5 min)  
JavaScript map video:    • forEach vs Map in JavaScript?!  

00:00 Introduction to forEach vs Map
00:16 forEach & map Refresh
00:28 Example 1: New Array of Cat names, forEach version
01:05 Why it's best to use map instead of forEach for this example
01:35 Example 1: New Array of Cat names, rewriting using map
01:55 Example 2: Array of cat names with only cats over the age of 7, forEach version
02:55 Example 2: Array of cat names with only cats over the age of 7, map/filter version
03:30 So...when would we use forEach?!

コメント