摘要: 阅读全文
posted @ 2020-03-02 22:31 Jinsuo 阅读(187) 评论(0) 推荐(0) 编辑
摘要: let nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; let res = nums.filter((num) => { return num > 5; }); console.log(res); // [6, 7, 8, 9, 10] 阅读全文
posted @ 2020-03-02 22:23 Jinsuo 阅读(168) 评论(0) 推荐(0) 编辑
摘要: var array1 = [1,4,9,16]; const map1 = array1.map(x => x *2); console.log(map1); 打印结果为: Array [2,8,18,32] <!DOCTYPE html> <html> <head> <meta charset=" 阅读全文
posted @ 2020-03-02 17:30 Jinsuo 阅读(90) 评论(0) 推荐(0) 编辑