Javascript - flatMap method over array - (flatMap is not a function)

后端 未结 3 498
迷失自我
迷失自我 2020-12-18 23:29

According to the Mozilla Developer Website:

The flatMap() method first maps each element using a mapping function, then flattens the result into a new array. It

3条回答
  •  情话喂你
    2020-12-19 00:25

    It means you're using a web browser or other development environment that does not support Array.prototype.flatMap (currently Edge and IE have no support). CanIUse table here.

    Also note that it is used primarily for multidimensional arrays (to avoid chaining map and flat, hence flatMap).

提交回复
热议问题