I am adding objects to an array like so:
fontSizeArray.push({element: $(y).prop("tagName").toLowerCase(), orginalSize:$(y).css("font-size"), size:$(y).css("font-size")});
this code inside a loop, what I am trying to do is eliminate the duplicates because some items will have the same tagName and the same font-size
I am trying to use in array, but its not working, the duplicates still remain.
if($.inArray({element: $(y).prop("tagName").toLowerCase(), orginalSize:$(y).css("font-size"), size:$(y).css("font-size")}, fontSizeArray) == -1)
{
fontSizeArray.push({element: $(y).prop("tagName").toLowerCase(), orginalSize:$(y).css("font-size"), size:$(y).css("font-size")});
}
What am I doing wrong?