2021-2-22js learning record

Learning problems:

  1. What kinds of outputs are commonly used in Js (commonly used)
  2. For the position of js
  3. Reasons for the existence of variables
  4. How are variables used?
  5. Representation of the variable's continuous reputation
  6. When declaring a variable, only declare the result without assigning a value
  7. When declaring a variable, the result of direct use without declaration or assignment
  8. When declaring variables, do not declare direct assignment and use the result

Reply:

  1. What are the commonly used output of Js (commonly used)
    a) Alert(), prompt(), console.log()
  2. For the location of js, you don’t know how to operate the implementation method, so you can experience it again.
    a) Principle. For the location in the Js line, it is mainly achieved by the method of event reference in the attribute of the tag element.
    b) Embedded: Pass Script tag to achieve
    c) External reference, to achieve through script:src.
  3. Why does the variable exist?
    a) Because the computer needs to operate on the data, an abstract concept is needed to store the data, so this is the variable, which is used to store different data types
  4. The principle of the use of variables?
    a) Existence, use the model
    b) Corresponding to the language in the computer is; first declare, then assign, life example: living in a hotel, you must first determine the hotel room, and then go to check in.
  5. The representation of the variable's continuous reputation
    a) Let a, b=1, c='ad';
  6. When declaring a variable, only the result of not assigning
    a value is declared a) The variable value is undefined
  7. When declaring variables, do not declare or assign the result of direct use
    a) Error
  8. When declaring variables, do not declare direct assignment to use the result
    a) It can be used normally,
    b) But it is not recommended to use it, because it will default to a global variable.

Guess you like

Origin blog.csdn.net/weixin_44767679/article/details/113928939