TheFirstSunday

Results 7 comments of TheFirstSunday

``` javascript function mySetInterval() { const [handler, duration] = arguments; mySetInterval.timer = setTimeout(() => { handler(); arguments.callee(...arguments) }, duration); } mySetInterval.clearInterval = function() { clearTimeout(mySetInterval.timer) } ```

const NOT_INCLUDE = -1; String.prototype.indexOf = function(string, start = 0) { if(typeof this !== 'string') throw new SyntaxError('SyntaxError, needs a string'); const reg = new RegExp(`${string}`, 'ig'); reg.lastIndex = start;...

``` javascript const normalize = (str = '') => { const result = {}; const array = str.split(/[\[\]]/g).filter(Boolean); const { length } = array; array.reduce((previousValue, currentValue, currentIndex) => { previousValue.value...

``` JavaScript function reverseNum(num) { if(!num) return num; if(num < 0) Number('-' + num.toString().slice(1).reverse()); return Number(num.toString().reverse()); } ```

``` JavaScript const max = Math.pow(2, 31) - 1; const min = -Math.pow(2, 31); const reverseNum = function(x) { var y = 0; while(x !== 0) { y = 10...

我来提个PR吧