Visitar URL original
Array cardio1 by Laryl14 · Pull Request #1 · Laryl14/JavaScript30 · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
changed wesbos#3 to ES6 arrow function
  • Loading branch information
laryl.li
laryl.li committed Feb 17, 2020
commit 11e19e89dce543d2048029a3a1c603c9ff075414
7 changes: 1 addition & 6 deletions 04 - Array Cardio Day 1/index-START.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@

// Array.prototype.sort()
// 3. Sort the inventors by birthdate, oldest to youngest
const sort = inventors.sort(oldestToYoungest);

function oldestToYoungest(a,b){
return a.year-b.year;
}

const sort = inventors.sort(((a, b) => a.year - b.year));
console.log(sort);

// Array.prototype.reduce()
Expand Down