Dreaming in Code

by Michael Zabel

Having spent the better part of last weekend and this week diving into the deep end of the JavaScript pond, my mind has begun to think in functions, variables, arrays, booleans and logical operators.  Yesterday, I continued my quest for JS fluency with a wonderful tutorial on Lynda.com.   It only ran about three hours long, but with me furiously taking down notes and trying out some practice examples on my own, the course actually took up about four hours of my time.  Not bad for some fresh brain wrinkles.  My one mistake was wrapping up the training session so close to bed time that I actually didn’t take the time to decompress, resulting in a night of JavaScript syntax racing through my mind in an infinite loop capable of crashing any modern day web browser.  We’re talking full out conversations and simple tasks manifesting as JavaScript operations in dreamland.  Illustrated below are a couple instances that I could recall:


var kitchenSink = window.prompt ( "full, empty" );
if (kitchenSink == "full" )  {
          return ( 'load the dishwasher' ); 

}  else if  ( kitchenSink == "empty" )  {
          return ( 'unload the dishwasher' ); 

}  else  {
          return ( 'where the hell are all of my dishes?' ); 
}

document.write ( "rent check" );
Advertisements