25

JS面试之数组的几个不low操作

 5 years ago
source link: https://juejin.im/post/5c92e385e51d450ce11df1d1
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前言 本文主要从应用来讲数组api的一些骚操作; 如一行代码扁平化n维数组、数组去重、求数组最大值、数组求和、排序、对象和数组的转化等; 上面这些应用场景你可以用一行代码实现? 1.扁平化n维数组 1.终极篇 [1,[2,3]].flat(2) //[1,2,

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK