Skip to content

Instantly share code, notes, and snippets.

@chalkpe
Last active April 27, 2018 06:44
Show Gist options
  • Select an option

  • Save chalkpe/b6759d8b33205d16859c5c3e7cd5a0da to your computer and use it in GitHub Desktop.

Select an option

Save chalkpe/b6759d8b33205d16859c5c3e7cd5a0da to your computer and use it in GitHub Desktop.
dimigo assignment
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