Love to create Classroom JS Basic review: JavaScript writing position
Review
JS Writing Position:
The bottom of the body tag.
The actual work is written in a pair of script tags within the head tag.
Alert () Pop-up box.
Console.log ()
Literal:
Numeric literals: integers, floating-point numbers, special characters (Infinity,nan).
String literals: All languages, numbers in a language, special strings.
Variable:
Defining variables
Rules for identifiers: The first character is a letter (a-z,a-z), an underscore, a $. Other characters can be letters (A-Z,A-Z), underscores, $, numbers. (You cannot use the keyword specified in js, reserved words).
Variable assignment: The right value is assigned to the left.
Usually we write variable declarations and assignments together:
Variable declaration elevation: Only the declaration is lifted, and the assignment of the variable is not promoted.
Data type: typeof ()
Number: Numeric type. integers, floating-point numbers, special characters.
String: Type.
The undefined:undefined type. Represents undefined. Oneself is a type.
Boolean: Boolean type. True,false.
Null: You are also a type.
The number type is converted to a string: number + "";
| 1 Console.log (12 + "3"); 123 |
The string type is converted to a number:
parseint (): Converted to an integer.
| 1 Console.log (parseint ("12.234 Hello World. 233")); 12 |
Parsefloat (): Converts a string to a floating-point number.
| 1 Console.log (parsefloat ("78.2341e3.7898 World")); 78234.1 |
This article copyright belongs to love to create class all, reproduced please indicate the source.
For more details, please visit the homepage of the AI Chong class website .
http://www.icketang.com/
JS Basics Review: Where JavaScript is written