JavaScript code is run in the browser and is written in the <script></script> tab.
JavaScript code can be placed in: 1, head part, 2, body part, 3, external script, encapsulated in the. js file, do not need to write <script></script> tag.
JS syntax Features: 1, Case sensitive, 2, weakly typed language, 3, end with a semicolon, 4, string recommended single quotation marks.
Data type: 1, Boolean Boolean type, 2, number digit, 3, string string, 4, undefined undefined, 5, NULL null object, 6, object type.
View variable type typeof (variable name), which returns a string of variable type. Type conversion parse* (variable name).
Sentence: = = The judgment value is equal; = = = Determines whether the type is the same, and then determines whether the value is the same. Non-digital judgment isNaN (); eval () converts a string to JS code execution.
Method Definition: Function method name (argument list) {method body}, first letter of method name is generally lowercase, if return value, use the return keyword in the method body. There is no method overload, and the method that is defined later overrides the method that is defined first. You can use arguments to get all the arguments that are an array.
Anonymous method: Function (argument list) {method body}; You can assign a method to a variable that represents a method.
Scope chain: A variable defined within a method that can be used inside a method and within a sub-method inside a method.
Basic JavaScript Concepts