I have a problem to prevent adding new object to array which has the same value of id like existing element of object in array. My array is like this:
var arr = [
{id:1, name:'Fabricio'},
{id:2, name:'Leontina'},
{id:3, name:'Rodrigo'}];
If I want to add object like this {id:2; name:'Evander'}, that couldn't be done because of id.