This file contains 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 exclamation = 'Whoa!'; | |
let sentence = `They are really similar to Python.`; | |
console.log(`Template Literals: ${exclamation} ${sentence}`); | |
// Template Literals: Whoa! They are really similar to Python. |
This file contains 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 nom(food="ice cream") { | |
console.log(`Time to eat ${food}`); | |
} | |
nom(); // Time to eat ice cream |
This file contains 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 joke(question, ...phrases) { | |
console.log(question); | |
for (let i = 0; i > phrases.length; i++) { | |
console.log(phrases[i]); | |
} | |
} | |
let es6Joke = "Why does JS single out one parameter?" | |
joke(es6Joke, "Because it doesn't", 'really like', 'all the REST of them!'); | |
This file contains 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
class Mammal { | |
constructor() { | |
this.neocortex = true; | |
} | |
} | |
class Cat extends Mammal { | |
constructor(name, years) { | |
super(); | |
this.name = name; |
OlderNewer