JS: Client (browser) scripting language weak type based on prototype event driver does not need to compile (run directly) The role of JS : Form verification, reduce the pressure on the service sideAdd a page animation effectdynamically change page content Ajax Network Requests
(a) Common dialog boxes
Alert () Dialog: This method is a method of the Window object that pops a dialog box in the browser (the method has no return value)
prompt () dialog box:2 parameters, one is the browser prompt information, the second is the default input box value, the return value is the input box information
confirm () Dialog: Pop up a dialog box in the browser, the user can only select correct or cancel, the return value corresponds to TRUE or false
Note: These three methods are all methods of the Window object, which can be used directly to get the information entered by the user through a dialog box.
(b) the difference between = = and = = =
First say = =: Determine whether the content is the same, the same return true, otherwise return false
say = =: First judge whether the content is the same, in determining whether the data type of 2 variables is the same
(c) function internal array arguments:
First, the array can only be used inside the function, to hold the actual arguments, as an item of the array, see an example below:
Operating effect:
Arguments.callee is a pointer to the function itself, typically used for function recursion
(iv) Local variables and global variables
Global variables: Acting on the whole scope
Local variables: defined in functions, used in function fields
Note: There is no concept of block-level scope in JS, which is illustrated by the following code:
Operating effect:
in JS, because it is a scripting language, very flexible, and high-level language is not the same, there is no block-level scope, if in Java, I is not defined
The role of JavaScript, JS Common Three kinds of dialog box; = = and = = = difference; function internal parameter array arguments to print arguments inside the function; JS Error: No block-level scope