摘要:
1、找到重复的元素 只找到是哪几个重复的元素 const findDup = (list = []) => { const result = []; list.forEach(item => { if(list.indexOf(item) !== list.lastIndexOf(item) && 阅读全文
posted @ 2021-03-25 21:28
香香香。。。。香菜
阅读(183)
评论(0)
推荐(0)
摘要:
普通的实现 累加n次初始值 String.prototype.nRepeat = function(count){ let str = this.valueOf(); let res = ''; while(count > 0){ res =res + str; count--; } } 优化方案 阅读全文
posted @ 2021-03-25 20:06
香香香。。。。香菜
阅读(93)
评论(0)
推荐(0)

浙公网安备 33010602011771号