This file contains hidden or 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
//start with a string literal | |
var a = "Hello, World"; | |
//add a new property to that string | |
a.dateCreated = "6-4-2013"; | |
//try to access that property | |
var b = a.dateCreated; | |
//b is still undefined |
This file contains hidden or 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
//version without passing in parameters that are not available in the function scope | |
;(function(){ | |
//code here | |
//why the leading semi colon? | |
// this is a safe way to keep from having conflicts with other code that uses the same | |
// self invoking functions but left off the colon | |
})(); |
NewerOlder