Home » JavaScript » JS based white level rookie summary (a) - based gr...

JS based white level rookie summary (a) - based grammar

Part of

" structure, form ", recently began" the behavior part of JavaScript learning, each language has its core syntax, JavaScript system includes five aspects:



  1. JavaScript
  2. acoustic objects and built-in objects
  3. BOM
  4. >
event processing model
the main is a summary of the first JavaScript core language definition: each programming language has its own core syntax, including data types, variables, constants, operators,.< /span>
statement.
JavaScript
Data types:
JavaScript
There are two types of storage values, one is the raw data type; the other two is the reference data type.

the raw data types are divided into 5 types, namely
Undefind, Null, Boolean, Number and String.JavaScript provide the typeof operator to determine whether a value belongs to which type of primitive data types. The data type can conversion, the Boolean value, the digital value converted to a string value (toString) method, can be used to convert digital parseInt () and parseFloat (the former). The latter is converted to an integer, converted to floating-point
;
reference data types, objects. Objects are divided into the original sound object, built-in objects, the host object three. The object to my own opinion about it and C language provided by the library almost, are good for us to use some functions or methods, which also contains some attributes of objects the commonly used objects are: (Object), Array (newarray
Var array name = new, Array ()), Data class, Global class, and so on, there are many objects, which provide a lot of methods for us to use.

function: function is a set of statements that can be called at any time. He is the kernel of JavaScript. The standard definition of a function is: function, >Function name (parameter 1, parameter 2,... Parameter n) {function body};

Feel the greatest differences and learning C language is their own definition of variables is weak type, the definition of a variable must be declared his data types do not need to JavaScript in the C language, which makes the scripting language more flexible, in addition there is a lot of his functions and methods, if not accumulated to a certain the amount and some familiarity with the code will inevitably feel tired or.

Latest