Array map function doesn't change elements

前端 未结 4 1499
Happy的楠姐
Happy的楠姐 2020-12-11 20:22

In JavaScript, I have an array, which is

array = [true, false]

In some cases, I am trying to initialize this array

array.map(i         


        
4条回答
  •  一整个雨季
    2020-12-11 21:02

    JavaScript Array map() Method

    *)creates a new array with the results of calling a function for every array element and it calls the provided function once for each element in an array, in order.

    Note: map() Method does not execute the function for array elements without values and it does not change the original array.

    more details

提交回复
热议问题