File tree Expand file tree Collapse file tree 2 files changed +63
-0
lines changed
Example/01 Lecture_Example/Basic Expand file tree Collapse file tree 2 files changed +63
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title > Document</ title >
7+
8+ < script >
9+ // Print "Hello World" to the console
10+ console . log ( "Hello World" ) ;
11+ // print "Hello World" to the document
12+ document . write ( "Hello World" ) ;
13+ // Print "Hello World" to the alert
14+ alert ( "Hello World" ) ;
15+ </ script >
16+
17+ </ head >
18+ < body >
19+
20+ </ body >
21+ </ html >
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title > Document</ title >
7+ < script >
8+
9+ // variable declaration
10+ var x = 5 ;
11+ console . log ( x ) ; // prints 5
12+
13+ // variable declaration with let
14+ let y = 10 ;
15+ console . log ( y ) ; // prints 10
16+
17+ Number1 = 20 ;
18+ console . log ( Number1 ) ; // prints 20
19+
20+ // variable declaration with const
21+ const z = 30 ;
22+ console . log ( z ) ; // prints 30
23+
24+ // z = 90; // Error: Assignment to constant variable
25+
26+
27+ // Example of variable
28+ Name = "Joy" ;
29+ age = 20 ;
30+ height = 5.8 ;
31+ console . log ( Name ) ; // prints Joy
32+ console . log ( age ) ; // prints 20
33+ console . log ( height ) ; // prints 5.8
34+
35+
36+
37+ </ script >
38+ </ head >
39+ < body >
40+
41+ </ body >
42+ </ html >
You can’t perform that action at this time.
0 commit comments