Skip to content
Advertisement

Remove duplicates and combine multiple lists into one?

How do I remove duplicates and combine multiple lists into one like so:

function([["hello","me.txt"],["good","me.txt"],["good","money.txt"], ["rep", "money.txt"]]) should return exactly:

JavaScript

Advertisement

Answer

Create a empty array push the index 0 from childs arrays and join to convert all values to a string separate by space .

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement