PHP is best

color my life by coding ...

2018年7月

July 11, 2018

JS中的 map, filter, some, every, forEach, for in, for of 实例

1. map有返回值,返回一个新的数组,每个元素为调用func的结果。let list = [1, 2, 3, 4, 5]; let other = list.map((d, i) => { return d * 2; }); console.log(other); // print: [2, 4, 6, 8, 10]2. filter有返回值,返回一个符合func条件的元素数组。...