File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 3737
3838// Array.prototype.filter()
3939// 1. Filter the list of inventors for those who were born in the 1500's
40+ const fiftenn = inventors . filter ( inventor => inventor . year >= 1500 && inventor . year < 1600 )
41+
42+
43+
44+ // if(inventor.year >= 1500 && inventor.year < 1600){
45+ // return true; // keep it!
46+ // }
47+
48+ console . table ( fiftenn ) ;
4049
4150// Array.prototype.map()
4251// 2. Give us an array of the inventors first and last names
43-
52+ const fullNames = inventors . map ( inventor => `${ inventor . first } ${ inventor . last } ` ) ;
53+ console . log ( fullNames )
4454// Array.prototype.sort()
4555// 3. Sort the inventors by birthdate, oldest to youngest
46-
56+ const ordered = inventors . sort ( )
4757// Array.prototype.reduce()
4858// 4. How many years did all the inventors live all together?
4959
You can’t perform that action at this time.
0 commit comments