JSFiddle - React, Tailwind, and code Playground
by shanimal
HTML
<div id="target"></div>
JavaScript
// We should never add functions to prototypes.
Array.prototype.remove = function(from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
};
// EXAMPLE PROBLEM
console.clear()
var a = [1,2,3,4,5,6,7,8,9,0];
var target = document.getElementById('target');
for(var i in a){
target.innerHTML += '' + i + ":" + a[i] + "<br/>";
}