This is an old revision of the document!
javascript
Functions
Functions in javascript can be named or anonymous. They have access to local variables that are in the scope of their parent functions.
function fun2(){ var output = "" if(typeof myGlobal != "undefined"){ output += "myGlobal: " + myGlobal; } if(typeof oopsGlobal != "undefined"){ output += " oopsGlobal: " + oopsGlobal; } console.log(output) }
Objects
These are defined with the following syntax:
var person = { firstName : "Jack", lastName : "Smith", age : 19, employed : true }