摘要:
Array.prototype.myReduce = function(fn,initValue){ if(this.length == 0){ throw new Error('Reduce of empty array with no initial value') } let i,total; 阅读全文
摘要:
class Link{ fn(params){ console.log(params) return this } } class Link{} Link.prototype.fn = function(params){ console.log(params) return this } 第二种方式 阅读全文
摘要:
function longestNoRepeatStr(str){ let len = 0 if(str.length == 0 || str.length == 1){ return str.length } for(let i = 0;i < str.length - 1;i++){ let a 阅读全文