I am trying to pull all unique Field
names from the returned results of an Ajax call. However, for whatever reason, the Field
name DRMrole
continues to appear twice.
Here is the jQuery I am using
//Construct array to determine unique Field names
var fieldArray = [];
$.each(data, function(i, item){
fieldArray.push(item.Field);
console.log(item.Field);
});
fieldArray = $.unique(fieldArray);
console.log(fieldArray);
And here are the readouts from the console.log
commands
As you can see, for some reason DRMrole
appears twice in the filtered results. This happens each and every time I run this code so doesn't appear to be random.