masking

Prev Top Next
var myVar = "I'm the global"
 
function masker(myVar){ 
 myVar// ?// "I'm the argument" -- outer variable gets masked 

 
masker("I'm the argument"); 
 
myVar// ?// "I'm the global" -- outer variable remains unchanged 
 
 
// look at usage for jQuery Plugins: 
// http://learn.jquery.com/plugins/basic-plugin-creation/#protecting-the-alias-and-adding-scope