Edit:
Context: I inherited a process (from a former co-worker) the generates a generic file that, among other things, creates the following list of items. The list will later need to be turned into a series of unordered links with nesting levels preserved.
From the following array, I need to remove duplicates regardless of how many times it shows up based on the href attribute's value.
var array = [
'<tag href="cheese.html">',
'<tag href="cheddar.html"></tag>',
' <tag href="cheese.html"></tag>',
'</tag>',
'<tag href="burger.html">',
' <tag href="burger.html">',
' <tag href="burger.html"></tag>'
' </tag>'
'</tag>'
'<tag href="lettuce.html">',
' <tag href="lettuce.html">',
' <tag href="lettuce.html"></tag>',
' </tag>',
'</tag>',
'<tag href="tomato.html">',
' <tag href="tomato.html"></tag>',
' <tag href="tomato.html">',
' <tag href="tomato.html"></tag>',
' <tag href="tomato.html">',
' <tag href="tomato.html"></tag>',
' <tag href="tomato.html">',
' <tag href="tomato.html"></tag>',
' </tag>',
' </tag>',
' </tag>',
'</tag>',
];
After the array has all duplicates removed, it should look like this:
'<tag href="cheese.html">',
'<tag href="cheddar.html"></tag>',
'</tag>',
'<tag href="burger.html">',
'</tag>',
'<tag href="lettuce.html">',
'</tag>',
From here, I have no problems extracting the info I need to generate my unordered list of links. I just need help figuring out how to remove the duplicates.
</tag>values?