JSFiddle - React, Tailwind, and code Playground
by cmacrander
JavaScript
var originalSplice = Array.prototype.splice;
Array.prototype.splice = function (start, deleteCount) {
'use strict';
if (deleteCount === undefined) {
arguments[1] = this.length - start;
}
console.log(arguments);
return originalSplice.apply(this, arguments);
};
alert([1,2,3].splice(0) + ' ' + [1,2,3].splice(1) + ' ' + [1,2,3].splice(0,1) + ' ' + [1,2,3].splice(1,1) + ' ' + [1,2,3].splice(1,2));