Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1eb8a95

Browse files
Adding basic JS programs
1 parent 7d7a3ab commit 1eb8a95

File tree

5 files changed

+45
-11
lines changed

5 files changed

+45
-11
lines changed

‎Intro_And_ControlFlow/basics1_Variables.js‎

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
11
console.log("Hello World");
22

3+
//Javascript Variables
34
let a = 4
4-
const b = 5.67
5-
var c="Ambuja"
5+
var b = 5.67
6+
// var is used in the older versions of JavaScript, let is the new way of declaring variables starting ES6 (ES2015).
67
let d = true;
7-
const e = null;
8-
let f;
8+
let f; // If you use a variable without initializing it, it will have an undefined value.
99
console.log(typeof(a));
1010
console.log(typeof(b));
11-
console.log(typeof(c));
1211
console.log(typeof(d));
13-
console.log(typeof(e));
1412
console.log(typeof(f));
15-
13+
console.log(f);//undefined
1614
console.log(!d);
1715

16+
let x=5, y=7, z=9;
17+
console.log(x);
18+
x = 3;
19+
console.log(x);
20+
21+
//Javascript Constants
22+
const c = "Ambuja"
23+
const e = null;
24+
console.log(typeof(c));
25+
console.log(typeof(e));
26+
// c = 10; // Error! constant cannot be changed.
27+
console.log(c)
28+
29+
//const p; // Error! Missing initializer in const declaration.
30+
p = 5;
31+
console.log(p)
32+
1833
const t1 = Symbol(7878)
1934
console.log(t1)
2035
console.log(t1.description)
@@ -35,10 +50,8 @@ console.log(typeof(student.fname))
3550
console.log(++student.age)
3651

3752

38-
console.log(2=='2')
39-
40-
console.log(2==='2')
41-
53+
console.log(2 =='2')
54+
console.log(2 ==='2')
4255
console.log(student.fname=='Ranjan')
4356

4457
delete student.fname
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("Hello World!");
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
console.log(`I love javascript`);
2+
console.log("Javascript is fun");
3+
4+
// Numeric Datatype
5+
console.log(8)
6+
console.log(80.5)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
3+
<html lang="en">
4+
<head>
5+
<meta charset="utf-8">
6+
7+
<title>Programiz</title>
8+
</head>
9+
10+
<body>
11+
<script src="main.js"></script>
12+
</body>
13+
</html>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('hello world');

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /