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 comments
3
Man. I wish i can think like this. How do you do ? I was stuck at this smilar knida problem (find if array contains duplicate value or not and just return true or false.) and it never clicked me.
4 u/StoneCypher May 14 '21 Man. I wish i can think like this. How do you doit's the accepted answer from the first result on googling "javascript unique"https://stackoverflow.com/a/14438954/763127it's pretty standard in the javascript community 4 u/learning_account_01 May 14 '21 Oh that shows how noob I am. I have lot to learn indeed. Thanks. 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.
4
Man. I wish i can think like this. How do you do
it's the accepted answer from the first result on googling "javascript unique"
https://stackoverflow.com/a/14438954/763127
it's pretty standard in the javascript community
4 u/learning_account_01 May 14 '21 Oh that shows how noob I am. I have lot to learn indeed. Thanks. 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.
Oh that shows how noob I am. I have lot to learn indeed. Thanks.
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.
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.
3
u/learning_account_01 May 14 '21
Man. I wish i can think like this. How do you do ? I was stuck at this smilar knida problem (find if array contains duplicate value or not and just return true or false.) and it never clicked me.