filmov
tv
Map vs forEach in javascript
Показать описание
Map and forEach in javascript are array methods which allow us to loop over its elements and perform any task on them. Although none of them changes the original array but you can create an another array with updated value.
in forEach you need to manually push the values into the new array while map automatically returns an array so we can directly assign the return value of map function to a variable
#javascript #java #coding #programming #reactjs #nodejs #python #angular #vuejs
in forEach you need to manually push the values into the new array while map automatically returns an array so we can directly assign the return value of map function to a variable
#javascript #java #coding #programming #reactjs #nodejs #python #angular #vuejs