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
const firstStep = { | |
initial: 'BREAK_UP', | |
states: { | |
BREAK_UP: { | |
on: { | |
START: 'START_PROPELLERS' | |
} | |
}, | |
START_PROPELLERS: { | |
on: { |
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 Hero { | |
constructor(name) { | |
this.name = name | |
} | |
prepareForBattle(increaseCount) { | |
console.log(`I am ${this.name}! Let's go fighting!`) | |
increaseCount() | |
} | |
} |
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
const superman = { | |
strong: true, | |
power: 120, | |
powerUp: function() { | |
setTimeout(function() { | |
if (this.power) this.power += 10 | |
}, 10) | |
}, | |
} |
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 Heroe { | |
constructor(name, isFromDC) { | |
this.name = name; | |
this.isFromDC = isFromDC; | |
} | |
info() { | |
console.log(`${this.name} is ${this.isFromDC ? '' : 'not '} from DC`) | |
} | |
} |
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
const heroes = [ | |
{ | |
name: 'Batman', | |
isFromDC: true, | |
info: function() { | |
console.log(`${this.name} is ${this.isFromDC ? '' : 'not '} from DC.`) | |
}, | |
}, | |
{ |
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
const batman = { | |
isFromDC: true, | |
info: function() { | |
console.log(`Batman is ${this.isFromDC ? '' : 'not '}from DC`) | |
}, | |
} | |
batman.info() // Batman is from DC. |
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
{ | |
const welcome = 'Welcome to our JS Workshop' | |
console.log(welcome) // 'Welcome to our JS Workshop' | |
} | |
console.log(welcome) // Error, welcome is not defined |
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
var name = 'FDV'; | |
function company() { | |
this.name = 'intive FDV'; | |
} | |
company.prototype.name = 'intiveFDV Disney'; | |
company.prototype.description = 'Great company to ...'; |
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
var name = 'Alexis'; | |
var bestProjectManager = (function() { | |
var name = 'Julito'; | |
return function() { | |
console.log(name); // log 'Julito' | |
}; | |
})(); |
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
var name = 'Damian'; | |
function Person() { | |
this.name = 'Leo'; | |
} | |
console.log(new Person().name); // log 'Leo' |
NewerOlder