Having studied CSS-related knowledge, I have some basic knowledge of front-end engineers. But to better grasp the front-end, you must learn good javascript knowledge.
The following will be interpreted from the perspective of basic syntax, variables, keywords, reserved words, statements, functions, BOMs, and so on.
First, the basic grammar
Javacript as an object-oriented, script-level lightweight language, with Java same strain.
Naming: Case sensitive, weak type definitions (typically Var, unrestricted type).
The end-of-line semicolon is optional (from experience, recommended writing, can improve the quality of code reading).
Parentheses are used for code snippets.
Note with C, Java type, single line with "//", segment Comment with "/**/".
Second, the variable
Declare the variable with the Var type.
Third, the data type
JavaScript has a total of 9 data types. are: undefined (undefined), null (NULL), Boolean, String, number, Object, Reference, List, completion.
The declaration of the array, var v_array = new Array (10);
can also, var v_array = new Array (0,1,2,4);
Iv. Basic Statements
Like other languages, JavaScript is also divided into sequential statements, conditional statements, and circular statements.
Definition and use of functions
The basic syntax for defining a function is as follows:
Function name (arg0,arg1,... ArgN)
{}
Vi. other objects
Date type data object, Math Math object. They all have some common methods and properties.
Vii. BOM Basis
The BOM is the abbreviation for the Brower Object model. They are the object of the browser and have interaction with the browser.
(1) Window object. is the browser's window. usually have Moveby (), MoveTo (), Resizeby (), Resizeto () and other common methods. Window's alert (), confirm (), prompt () and other methods are also more common.
(2) Document object. The most common is the write () method
(3) Location object. Used primarily to set the URL address.
(4) Navigator object. The main access to the browser information.
(5) Screen object. The main access to screen information.
Now that you've only learned the basics of JavaScript, the next blog will discuss the advanced knowledge of JavaScript.
This article is from the "on the road to Chasing Dreams" blog, please be sure to keep this source http://wangyu19900123.blog.51cto.com/6190851/1543340