Skip to content

Instantly share code, notes, and snippets.

View jennz0r's full-sized avatar
🍦
.

Jenn jennz0r

🍦
.
View GitHub Profile
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.
function nom(food="ice cream") {
console.log(`Time to eat ${food}`);
}
nom(); // Time to eat ice cream
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!');
class Mammal {
constructor() {
this.neocortex = true;
}
}
class Cat extends Mammal {
constructor(name, years) {
super();
this.name = name;