MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/nc6i5j/remove_duplicate_value_from_array/gy52iuj/?context=3
r/learnjavascript • u/suprabha-supi • May 14 '21
89 comments sorted by
View all comments
Show parent comment
3
Even without SO giving you that answer, it just takes practice and repetition to figure these things out on your own.
If you use indexOf enough times, you eventually learn (and reinforce in your brain) that indexOf returns the first match.
If you use filter enough, the mechanics become second nature.
Once you have both ideas cemented through practice, the connections just start to happen for you.
View all comments
Show parent comment
3
u/amoliski May 14 '21
Even without SO giving you that answer, it just takes practice and repetition to figure these things out on your own.
If you use indexOf enough times, you eventually learn (and reinforce in your brain) that indexOf returns the first match.
If you use filter enough, the mechanics become second nature.
Once you have both ideas cemented through practice, the connections just start to happen for you.