摘要: //手机构造函数 function Phone(brand, price) { this.brand = brand; this.price = price; } //添加 方法 Phone.prototype.call = function() { console.log('我打电话') } // 阅读全文
posted @ 2022-10-25 16:26 小白字太白 阅读(10) 评论(0) 推荐(0) 编辑
摘要: map为键值对集合 let m = new Map(); m.set('name', '小白'); m.set('chang', function() { console.log("改变自己"); }) let key = { school: 'NONGDA' }; m.set(key, ['bei 阅读全文
posted @ 2022-10-25 10:19 小白字太白 阅读(55) 评论(0) 推荐(0) 编辑
摘要: let arr = [1, 2, 3, 4, 5, 4, 3, 2, 1]; //数组去重 let result = [...new Set(arr)]; console.log(result); //交集 let arr2 = [4, 5, 5, 6, 6]; let result = [...n 阅读全文
posted @ 2022-10-25 10:05 小白字太白 阅读(15) 评论(0) 推荐(0) 编辑