Array Methods In Javascript

map, filter, and find are pretty obvious.

There’s one small caveat with find: if it can’t find anything, it returns undefined, otherwise it returns the element it finds.

forEach is used when you’re actually intending to cause a side-effect—it’s a predictable, red-bold-letters way of letting the reader know that your script is operating outside the scope of the function for the forEach section only and nothing else.

Array chaining is actually pretty inefficient in Javascript

Created from: Modern Javascript Course 202006070113


uid: 202006160146 tags: #programming #javascript


Date
February 22, 2023