-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
110 lines (110 loc) · 4.46 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="navbar">
<h1>Learning JavaScript</h1>
<div class="menu">
<a href="#">TOPICS</a>
<a href="#">CODES</a>
<a href="#">QUIZ</a>
</div>
</div>
<div class="content">
<h2>Introduction to JavaScript</h2>
<p>JavaScript is a programming language that adds interactivity to web pages.</p>
<p>JavaScript can be used to create dynamic and interactive web pages.</p>
<p>JavaScript is widely used for web development, animation, and creating interactive web applications.</p>
<p>JavaScript is also used for client-side scripting in web browsers, and it can be used to create server-side scripts using Node.js.</p>
</div>
<div class="content2">
<div class="p1">
<div class="printing">
<h2>How to print Output in JS?</h2>
<p>To print output in JavaScript, you can use the console.log() method.</p>
<p>Example:</p>
<pre>console.log("Hello, World!");</pre>
<p>Output:</p>
<p>Hello, World!</p>
</div>
<div class="data_types">
<h2>Data Types in JS</h2>
<p>JavaScript has different data types:</p>
<ul>
<li>Number</li>
<li>String</li>
<li>Boolean</li>
<li>Undefined</li>
<li>Null</li>
<li>Symbol (ES6)</li>
<li>Object (including Arrays and Functions)</li>
</ul>
<p>Example:</p>
<pre>var x = 10; // Number
</div>
</div>
<div class="variables">
<h2>Variable Declaration in JS</h2>
<p>Variables are used to store data in a memory location.</p>
<p>Syntax:</p>
<pre>var variableName = value;</pre>
<p>Example:</p>
<pre>var name = "John Doe";</pre>
<p>You can also declare and initialize variables in one line:</p>
<pre>var name = "John Doe", age = 30;</pre>
<p>We can also create variables using let & const.</p>
<h2>Using let variable</h2>
<pre>let name = "John Doe";</pre>
<h2>Using const variable</h2>
<pre>const name = "John Doe";</pre>
</div>
</div>
<div class="content3">
<h2>Diffences between variable declaration</h2>
<p>There are some differences between variable declaration:</p>
<ul>
<li>var: It is function-scoped and hoisted, meaning its value can be accessed before it is declared.
It can be reassigned but not redeclared within the same function.</li>
</li>
<li>let: It is block-scoped and hoisted, meaning its value can be accessed before it is declared.
It can be reassigned but not redeclared within the same block.</li>
</li>
<li>const: It is block-scoped and hoisted, meaning its value can be accessed before it is declared. It also cannot be reassigned.</li>
</ul>
</div>
<div class="operators">
<h2>Operators in JavaScript</h2>
<p>JavaScript supports the following operators:</p>
<ul>
<li>Arithmetic Operators: + , - , * , / , %</li>
<li>Assignment Operators: = , += , -= , *= , /= , %=</li>
<li>Comparison Operators: > , < , >= , <= , == , === ,!= ,!==</li>
<li>Logical Operators: && , || , !</li>
<li>Bitwise Operators: & , | , ^ , ~ , << , >> , >>></li>
<li>Ternary Operators: condition? value1 : value2</li>
</ul>
</div>
<div class="category">
<h1>Topics to Learn</h1>
<p>Just click on the topics and you'll be redirected to the another page.</p>
<ul>
<li>Array</li>
<li>Object</li>
<li>Function</li>
<li>Loop</li>
<li>Deep Copy & Shallow Copy</li>
<li>Synchronous & Asynchronous</li>
<li>Callback & Promise</li>
</ul>
</div>
<footer>
<p>©2022 Learning JavaScript. All rights reserved.</p>
<a href="#">Made by Sachin</a>
</footer>
</body>
</html>