Introduced:
Single, double line comments:
The output syntax of JS
Pop-up Window form alert ();
alert (123);
The effect is as follows:
The prompt () method is used to display a dialog box that prompts the user for input
Prompt (' Please enter name ');
The effect is as follows:
document.write () print in an HTML document
document.write (123);//Can be displayed directly in the document
The effect is as follows:
Console output: Console.log (); General as debug output statement
Console.log (123); Control Desk
The effect is as follows:
Variable:
Note the naming conventions:
JS inside: Letters, numbers, underscores, $ symbols, such as 4 components, the number can not be the beginning of the name of the content.
Hump method naming
Assignment value:
var i=0;
I=1;
alert (i);
The effect is as follows:
Data type:
Number
var I=1;
Alert (typeof (i));
The effect is as follows:
Character:
var i= "abc";
Alert (typeof (i));
The effect is as follows:
To determine the Boolean:
var i=true; False
Alert (typeof (i));
The effect is as follows:
No objects selected:
var i=0;
Alert (typeof (a));
The effect is as follows:
Array:
var obj=["AA", "BB", "CC"];
Alert (typeof (obj));
The effect is as follows:
Introduction to
JS basics, annotations, variables, data types, and output syntax