Skip to content

Instantly share code, notes, and snippets.

@pr00thmatic
Created February 23, 2015 00:42
Show Gist options
  • Select an option

  • Save pr00thmatic/c0ed1f31d20d54061261 to your computer and use it in GitHub Desktop.

Select an option

Save pr00thmatic/c0ed1f31d20d54061261 to your computer and use it in GitHub Desktop.
console.log(dog.nombre) // undefined
with (dog) {
try {
console.log(nombre) // error
} catch(error) {
console.log('nombre is not defined even inside the with (dog)');
}
}
dog.setName = function () {
console.log(nombre);
}
try {
dog.setName(); // error
} catch(error) {
console.log('nombre is not defined even if the function is replaced');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment