Javascript notes

var variable = constant; // any type
vari = true; // false
// global except within a function's scope

"a string"
"str".length;
"01234".substring( begin_0_Index, length ); // 1,2 => "12"
"original string".replace("word to be replaced", "replacement word");

var array = [ 1, 2, 3 ]; // is array a keyword?
array[ 0 ] = 9;
bla = array[ 2 ];

if ( x === 10 ) // identical value, distinct from n == nn not yet sure how
    something( );
else if ( condition( ) && !falseCondition( ) )
    another( );
else
    lastThing( );

while ( condition )
    repeatedCode( );

for ( nn = variable; condition( nn ); step( nn ) )
    repeatedCode( );

var functionName = function( arguments ) // every time, oh my
{   stuffWith( arguments );
}; // yup, ending semicolon

alert( "title" ); // has ok button
confirm( "message" + value ); // has ok & cancel
prompt( "get a string of input" );
// ? console.log( "blah" );