I’ve tried everything my smooth brain could come up with and I can’t get it right. I’ve opted for making a Set since it takes no duplicates, but I get “Reference Error: el is not defined” and I really don’t know what to try anymore
Your code so far
nodupes: nums => nums.map((el), () => new Set().map())
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Challenge Information:
Learn Functional Programming by Building a Spreadsheet - Step 102
I don’t understand what you want to do honestly, why do you have a map call inside a map callback? what do you need the second one for? why are you creating a set of a single element and calling map on it?
To be honest I’m not really sure either. I’m trying to make a Set out of the values of “nums” first, and then make the set an array again? Maybe this is not the right approach at all
Hello again, I managed to do it by making a new Set from array first, and then Array.from(). I’m sorry for the mess.
Still, I’m wondering how this could be done with map(), and maybe filter() replace(). It probably has multiple correct answers and I’m just trying to understand what are my options and what is better to do. Thank you for your patience
EDIT: I’m just now looking at the recommended solution shown in the next step where spread is used.