SyntaxFix
Write A Post
Hire A Developer
Questions
Simple solution (ES6)
If you don't have duplicate element
Array.prototype.remove = function(elem) { var indexElement = this.findIndex(el => el === elem); if (indexElement != -1) this.splice(indexElement, 1); return this; };
Online demo (fiddle)