Last active
April 27, 2018 06:44
-
-
Save chalkpe/b6759d8b33205d16859c5c3e7cd5a0da to your computer and use it in GitHub Desktop.
dimigo assignment
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
| function* read (n) { | |
| while ((n = Number(prompt('enter a number')))) yield n } | |
| const main = (arr = [...read()].sort((a, b) => a - b)) => | |
| console.log('arr:', arr.slice(), '\nmin:', arr.shift(), '\nmax:', arr.pop()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment