Skip to content

Instantly share code, notes, and snippets.

@jiristepan
Created October 19, 2018 09:26
Show Gist options
  • Save jiristepan/f6fc70ed7e191897225099e9cbcec9eb to your computer and use it in GitHub Desktop.
Save jiristepan/f6fc70ed7e191897225099e9cbcec9eb to your computer and use it in GitHub Desktop.
Chicken egg problem solved by javascript
let question = ['🥚','🐔']
let answer = question.sort()
console.log(answer[0] + ' was first!')
@bencelaszlo
Copy link

One-liner:
console.log(['🥚','🐔'].sort()[0] + ' was first!')

@MostafaSaadatnia
Copy link

Good reason!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment