Introduction to JavaScript Basics

Source: Internet
Author: User
Tags variable scope

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.