Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Helpful example code to demonstrate the use of "this" in JavaScript for my article at
// Example 2. Default Binding.
function getPokémon(){
console.log("Pokémon in Ultra Ball is : ", this.ultraBall);
var ultraBall = "Articuno";
// Output
// Pokémon in Ultra Ball is : Articuno
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment