Last active
June 19, 2020 17:18
-
-
Save geomago/a9022e695d49e546506165f9f408916f to your computer and use it in GitHub Desktop.
remove_dupl_2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let unique = cars.filter ( (item,index) => index === cars.findIndex ( car => car.make === item.make && car.model === item.model) ); | |
| // RESULT IS: | |
| [ | |
| {id:1,make:"Ferrari",model:"812GTS",price:336000,colour:"rosso corsa"}, | |
| {id:2,make:"Ferrari",model:"F8 Spider",price:262000,colour:"giallo modena"}, | |
| {id:3,make:"Lamborghini",model:"Aventador S",price:329400,colour:"blu le mans"}, | |
| {id:4,make:"Bugatti",model:"Chiron Pur Sport",price:3000000,colour:"blue"}, | |
| {id:5,make:"McLaren",model:"New GT",price:203000,colour:"helios orange"} | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment