Created
December 13, 2016 01:10
-
-
Save faddah/54482188b1c0148bff14acee16bae092 to your computer and use it in GitHub Desktop.
JavaScript trying to add key/value pair with Map.property.set()
This file contains 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
document.querySelector('#outcome5').innerHTML = inventors.sort((a, b) => { | |
const lastPersonAge = a.passed - a.year; | |
const nextPersonAge = b.passed - b.year; | |
a.set(age, lastPersonAge); | |
b.set(age, nextPersonAge); | |
return nextPersonAge > lastPersonAge ? 1 : -1; | |
}).map(inventor => ` ${inventor.first} ${inventor.last} — age: ${inventor.passed - inventor.year}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment