Last active
September 29, 2017 21:46
-
-
Save rbren/3b123552ddbd5dce0158ff0ad4fa2bf5 to your computer and use it in GitHub Desktop.
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 hn = require('@datafire/hacker_news').create(); | |
(async () => { | |
let users = await Promise.all([ | |
hn.getUser({username: 'sama'}), | |
hn.getUser({username: 'pg'}), | |
]); | |
let [more, less] = users.sort((a, b) => b.karma - a.karma); | |
console.log(`${more.id} has more karma (${more.karma}) than ${less.id} (${less.karma})`); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment