------------------------------------------------------------------------------- Java Script Notes. Basic constrution is like "C++" Staements end in ';' though are not required comments start with // to end of line Multi-line and in-line comments /* ..... */ ------------------------------------------------------------------------------- Output... console.log(...) write to the browsers console Alert() Various popup boxes (use sparingly, good for debugging) Confirm() Prompt() ------------------------------------------------------------------------------- Variables Names are case sensitive. X and x are different variables. They are dynamic types, so can be a boolean, integer, float, or string. Do not need to be declared. If on declared they are global. y=5; y=y+1; let x = 30; // scoped only in current block (preferred) var z = 50; // scoped in current function true boolean literals false undefined special value 'string' "John's Computer" name + "'s Computer" // + is string concatenation "${name}'s Computer" // embedding a variable var x = Math.floor(5/2); // round down float to integer Math.random() // random number from 0 (inclusive) to 1 (exclusive) var result = Math.floor(10 * Math.random()); // random integer, 0 to 9 isNaN() // is it not a number, eg may be a string or illegal result -------------------------------------------------------------------------------