JSFiddle - React, Tailwind, and code Playground

by Roman Joseph Rimorin

JavaScript

Array.prototype.removeAt = function(id) {
        for (var item in this) {
            if (this[item].id == id) {
                this.splice(item, 1);
                return true;
            }
        }
        return false;
    }

$(document).ready(function() {
    
    var obj = [ { "id": "123", "name": "John" }, { "id": "11", "name": "Mary" } ];
    
    console.log(obj);
    
    setTimeout(function() {
        obj.removeAt("11");
        console.log(obj);
    }, 5000);
});