Last active
August 5, 2016 04:20
-
-
Save pombadev/47ebfe6342cc3271463e79fefc3311ef to your computer and use it in GitHub Desktop.
CoffeScript official examples in ES6
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
// CoffeeScript | |
square = (x) -> x * x | |
cube = (x) -> square(x) * x | |
fill = (container, liquid = "coffee") -> | |
"Filling the #{container} with #{liquid}..." | |
// ES6 | |
let square = (x) => x*x | |
let cube = (x) => square(x)*x | |
let fill = (container, liquid = null) => `Filling the ${container} with ${liquid}...` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment