This is the first day of my participation in the August More text Challenge. For details, see: August More Text Challenge

Consolidate the basic knowledge of learning JavaScript, deepen the understanding of memory, to build a firm foundation! Come on

Most of the content is vernacular content, the foundation in the foundation uses own understanding, simple have comprehensive summary basic knowledge, convenient deepen understanding!

For more detailed learning – see mdN-javascript documentation, (Little Red Book/White Paper/Blue Book /.) Learning the advanced

1. What is JavaScript?

JavaScript is a high-level/dynamic/interpreted programming language that is well suited to object-oriented and functional programming styles.

JavaScript’s variables are untyped, and its syntax is roughly similar to Java’s, but otherwise unrelated

  • Is a secure client-side scripting language used to implement andwebPage interaction
  • Runtime environment: Browser
  • The soul of page action

2,

  • Scripting language: Language embedded inhtmlIn the code
  • jsYou can make static elements in the page move

3. What constitutes JavaScript?

  • ECMAScriptThe European Computer Manufacturers Association is an organization used to regulateJavaScriptgrammarES5 ES6.
  • BOM: Browser object model
  • DOM: Document object model

4. JavaScript code to implement internal scripts or external connections

  1. All js code must appear in<script>Beginners are advised to place the tag under body
  2. <script>Tag location is arbitrary except within the title tag
  3. use<script src='xx.js'>
  4. withsrcProperties of thescriptInvalid JS code inside tag

5. Several output statements of JavaScript

  • alert()A pop-up dialog box blocks other code execution
  • console.log()Console output is used for debugging
  • document.write( )Output in the browser

Shortcut:

  • ctrl + /Single-line comments
  • ctrl + shift + /Multiline comment
  • CTRL + up arrowAdjust code up (down arrow adjust code down)
  • ctrl + DDelete a whole line

Conclusion:

  • .This is called document.write()
  • .And then the parentheses are called document.write()
  • .There are no parentheses called properties

6. Comments in js

  • // Here are the commentsSingle-line comments
  • /** Here is the comment */Multiline comment

7, js literal (constant) fixed invariable quantity

  • The numerical number
  • The integer
    • Decimal integer0-9 90
    • binary0 1composition
    • Octal 0–7 is usually formed with0 at the beginning 076
    • Hexadecimal 0–9 a–f usually in 0x color:#ffffff
  • The decimal
  • Character string

    One or more in quotation marks

    But notice that the quotes are nested “” “” “” “”

  • Boolean value: true false

8. Identification in JS(zhi)Naming conventions for characters (variables)

  • 1. Consists of alphanumeric digits and underscores (_) $
  • 2. Do not start with a number
  • 3. The name cannot be a keyword specified by the system

Example: a3 sname age-age (error) _json 5a(error)

  • Don’t name it emotionally
  • Hump nomenclature:
    • Small hump zuiAiNiDeRen getElementById()
    • Big hump ZuiAiNiDeRen
  • Hungarian naming:
    • iNum = 90
    • oBtn object

9. Variables in js

What is a variable: a value that may change during the course of a program

10. Define and assign variables

Var num = 90;

Variables must be defined before they are used

11, js output results pay attention to several problems:

  • 1, if the output is a variable, do not put quotation marks
  • 2. If the output is a character, it must be in quotes
  • 3, if the output is a number, do not use quotation marks
  • 4, if the output characters and variables, must be + connection

12. Data types of variables (key)

  • Basic data types:
    • There are multiple string values
    • The value of number has multiple values
    • Boolean values have two values: true, true, false, false
  • Compound data types (reference data types, object data types) : object
  • Special data type: undefined NULL
  • The function function

Test the data type of the variable

  • Typeof variable
  • Typeof value: string number Boolean undefined object-function (no null)

The following continues with Day1

Day1 (2)

Just keep up with the pace and move forward. Calm Down & Carry On!