摘要:
function deleteChar(str, n) { var num = -1 return str.replace(/a/g, item => { num++; return num == n ? '' : item }) } deleteChar("12 a 3 4 a 45 8a 768 阅读全文
摘要:
1 Array.prototype.myReduce = function (f, v) { 2 let sum = v || this[0] || 0 3 let curIndex = v ? 0 : 1 4 for (let i = curIndex; i< this.length; i++) 阅读全文