(and doing)
Lonce Wyse
Communication & New Media
lonce.wyse@cnm.nus.sg
A
E
C
B
D
fin
test
do
start
1) loops
2) conditionals
3) lists
4) objects
5) functions
6) timers
7) events
1) loops - for ( counter=1 to 10 ) { do something with counter }
2) conditionals - if ( true) { do something } else { do another thing }
3) lists - alist[0] = "star wars"; alist[1] = "Jurrasic Park"; alist[2] = "Ice Age";
4) objects - kitchen = { "numForks" : 6,
"ovenSize" : "large" ,
"makeCake" : function }
kitchen.numForks = 6; or kitchen["numForks"] = 6;
5) functions - makeCake = function(ingrediants){recipe steps; return cake}
6) timers - setTimeout( {do something}, 1 day )
7) events - onClick ( {do something} )
1) loops - for ( counter=1 to 10 ) { do something with counter }
2) conditionals - if ( true/false ) { do something } else { do another thing }
3) lists - alist[0] = "star wars"; alist[1] = "Jurrasic Park"; alist[2] = "Ice Age";
4) objects - kitchen = { "numForks" : 6,
"ovenSize" : "large" ,
"makeCake" : function }
kitchen.numForks = 6; or kitchen["numForks"] = 6;
5) functions - makeCake = function(ingrediants) { recipe steps; return cake }
6) timers - setTimeout( {do something}, 1 day )
7) events - onClick ( {do something} )
How to express with JavaScript syntax