[removed] Difference between .forEach() and .map()

后端 未结 12 2012
余生分开走
余生分开走 2020-11-22 15:19

I know that there were a lot of topics like this. And I know the basics: .forEach() operates on original array and .map() on the new one.

I

12条回答
  •  遥遥无期
    2020-11-22 15:40

    Diffrence between Foreach & map :

    Map() : If you use map then map can return new array by iterating main array.

    Foreach() : If you use Foreach then it can not return anything for each can iterating main array.

    useFul link : use this link for understanding diffrence

    https://codeburst.io/javascript-map-vs-foreach-f38111822c0f

提交回复
热议问题