Skip to content

Instantly share code, notes, and snippets.

View Eddcp's full-sized avatar
👾
Do or do not there is no try

Eduardo Costa de Paiva Eddcp

👾
Do or do not there is no try
View GitHub Profile
class Animal {
constructor(name) {
this.name = name
}
eat() {
console.log(`${this.name} is eating`);
}
}
var Animal = function (name) {
this.name = name;
}
Animal.prototype.eat = function () {
console.log(this.name + ' is eating!');
}
var Dog = function (name) {
Animal.call(this, name);
(function () {
var gandalfQuote = 'You shall not pass!';
})();
console.log(gandalfQuote);
console.log(person);
var person = 'Jon Snow';
var goodGuys = ['Frodo', 'Sam', 'Gandalf'];
for (var i = 0; i < goodGuys.length; i++) {
console.log(goodGuys[i]);
}
console.log(i);
@Eddcp
Eddcp / hoisting.js
Last active February 26, 2019 12:37
person = 'Jon Snow';
var person;
console.log(person);