摘要: 将类数组转换未数组的几种方法 1. Array.prototype.slice.call() function sum(a,b,c) { let args = Array.prototype.slice.call(arguments) console.log(args.reduce((sum, cu 阅读全文
posted @ 2019-11-09 17:18 ichthyo-plu 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 继承实现的几种方式 1.借助call实现继承 function p1() { this.name = 'p1' this.say = function () { console.log(this.name) } } var Parent1 = p1 Parent1.prototype.show = 阅读全文
posted @ 2019-11-09 16:40 ichthyo-plu 阅读(137) 评论(0) 推荐(0) 编辑