jimmy ye

Results 2 comments of jimmy ye

'''js function matchCount(str, letter) { const reg = new RegExp(`${letter}`, 'g') const matchArr = str.match(reg) // console.log(matchArr, reg) return matchArr.length } console.log(matchCount('adsadasdasdadsas', 'a')) '''

上面的理解错了 ```js function matchCount(str) { if (typeof str === 'string') { const strArr = str.split('') const map = {} let tick = 1 for (let i = 1; i <...