Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove object from array of object

const arr = [{ id: 1, username: "sdjb" }, { id: 3, username: "skdjh" }, { id: 5, username: "" }, { id: 5, username: "" }, { id: 5, username: "" }, { id: 5, username: "" }, { id: 5, username: "" }];
var filtered = arr.filter(function(idx) { return idx.username != ""; });
console.log(filtered);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #object #array #object
ADD COMMENT
Topic
Name
3+2 =