JavaScript compositionECMAScript: Interpreter, translator Dom:document object Model Bom:browser object model– the compatibility of each component, compatibility problem originVariable TypeType: typeof operator • Usage, return value • Common types: –number, String, Boolean, Undefined, object, functionl a variable should hold only one type of data • Example: Calculating two text boxes and • Explicit type conversions (Coercion type conversion) –parseint (), parsefloat () –nan Meaning and detection • Implicit type conversion –==, ===– subtractionvariable scopes and closuresL Variable Scope (SCOPE) • Local variable, global variable L what is a closure • Child functions can use local variables in parent functions • Previous closures • Definition of closures on the webNaming ConventionsL nomenclature and necessity and readability--can understand and standardize--conform to the rules L Hungarian nomenclature • Type prefix • Initial capitalizationoperatorL Arithmetic: + Plus, minus, * multiply,/divide,% modulo • Example: interlaced color, seconds to time l Assignment: =, + =,-=, *=,/=,%=l relationship:<, >, <=, >=, = =, = =, = =,!==l logic:&& and, | | Or! No • Example: Select all and Inverse l operator precedence: parenthesesProgram Flow ControlL Judgment: If, switch,?: L Loop: While, Forl jump: Break, Continuel What is true, what is false: • True: true, not 0 digits, non-empty string, non-empty object • False: False, number 0, empty string, empty object, UndefinedJSON IntroductionL What are jsonljson and arrays Ljson and for in with typeof View 12, ' ABC ' and type of document • Calculate the sum of the numbers in the two input boxes • Put a button, each time you click, pops up a number larger than the last 1:0,1,2,3,4... Enter two numbers, pop up a larger value • Enter a number to determine whether it is a two-digit numberL must doEasy Web Calculator
Introduction to JavaScript Basics