JSFiddle - React, Tailwind, and code Playground
JavaScript
if(typeof Array.prototype.remove === "undefined") {
Array.prototype.remove = function(e) {
this.splice(this.indexOf(e), 1);
}
}
var a = ['4', '5'];
a.remove('5');
alert(a);
if(typeof Array.prototype.remove === "undefined") {
Array.prototype.remove = function(e) {
this.splice(this.indexOf(e), 1);
}
}
var a = ['4', '5'];
a.remove('5');
alert(a);