Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js add to array if not exists

const key = 'mDisplayName'
let updatedData = [...new Map(data.map(item => [item[key], item])).values()];
updatedData.map((item)=>{
	console.log(item);
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #add #array #exists
ADD COMMENT
Topic
Name
9+4 =