Results 4 comments of icedJuice

同时打出 10 跟 20 ``` var b = 10; (function (c){ b = 20; console.log(b); console.log(c); })(b); ``` 只打出10 ``` var b = 10; (function (){ c = 20; console.log(b);...

function findRep (string) { const res = string.match(/(\w)(\1+)?/g); const len = Math.max(...res.map(e => e.length)); return res.filter(e => e.length === len).reduce((red, e) => end[e[0]] = e.length, {}) } console.log(findRep('abbkejsbcccwqaa')) // {c:3}...

const removal = array => JSON.parse('['+ JSON.stringify(array) .replace(/\]|\[|\s/g, '') .split(',') .filter((e, i, arr) => arr.indexOf(e) === i).join(',') +']'); console.log(removal([123, 234, {a: 1}, {a: '1'}, {a: 1}, 123])) // [123, 234,...