Skip to content

Preparing to JS interview

Wasyl Gutnyk edited this page Jul 30, 2021 · 1 revision

question:

1) What is difference between map and forEach methods?

answer: forEach method doesnt used to create new array, it just iterates through the array and makes some modifications with element map returns the array element, you can iterate through array, make some changes to the each item of it and return new array. Remember, It doesnt mutate initial array.

sdfsdf

Clone this wiki locally