51

一些使 JavaScript 更加简洁的小技巧-WEB前端开发

 5 years ago
source link: http://www.css88.com/archives/9868
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.
推荐9个使 JavaScript 代码变得更加简洁的小技巧,大概5分钟就能掌握。 1.清空或截断数组 在不重新给数组赋值的情况下,清空或截断数组的最简单方法是更改​​其 length 属性值: const arr = [11, 22, 33, 44, 55, 66]; // truncanting arr.length = 3; console.log(arr); //=> [11,

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK