js remove json value duplicates
var json = [
{"text":"menu1","parent":"#","id":"128102"},
{"text":"menu1.1","parent":"128102","id":"128103"},
{"text":"menu1.1","parent":"128102","id":"128103"}
];
var ids = [];
var clean = [];
$.each(json, function(index, value) {
if($.inArray(value.id, ids) == -1)
{
ids.push(value.id);
clean.push(value);
}
});
Also in JavaScript:
- vue get component hash
- how to remove first element of array in javascript
- nodejs json data serving
- Check ratelimit discord js
- get each primary colour and add into an array javascript
- javascript arrays codeburst
- check if element is visible jquery
- chartjs bar chart hover color
- react native slow performance after load iamges
- java code that writes code in powerpoint
- push array javascript
- Amazon VPC supporting 5 different IP address ranges and i wanted to know how wide those rangers are
- get value in maps loop using enzym
- printing in a single line in javascript
- expo app.json
- first element of array js
- devexpress gridview add new row without datasource
- js numbers
- object destructuring default value
- js navigate to another page
- use vue cdn with firestore
- how to proxy enable in server nodejs
- lexical scope javascript
- multiple image upload with preview and delete react js