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
// Example 2. Default Binding. | |
function getPokémon(){ | |
console.log("Pokémon in Ultra Ball is : ", this.ultraBall); | |
} | |
var ultraBall = "Articuno"; | |
getPokémon(); | |
// Output | |
// Pokémon in Ultra Ball is : Articuno |
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
// Example 1. Call-sites and Call-stacks | |
function thunderbolt(){ | |
debugger; | |
console.log("Using Thunderbolt!"); | |
} | |
function attack(){ | |
console.log("Attacking!"); | |
thunderbolt(); // <- Call-site for thunderbolt() | |
} |
NewerOlder