-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjavascript.js
76 lines (47 loc) · 1.39 KB
/
javascript.js
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
// Hitesh Chaudhary Class - 4
const name = "Unnita"
let roll = 1234
var dish = 'Jalebi Gol Gappe'
let shizuka ; // returns undefined
/* Never use VAR as it adds unneccessary bugs in code,
Because of issue in block scope & functional scope
*/
state = " Delhi "
// declaring variable without any keyword : bad practice
// name = 23 // not applicable as it is a const
roll = 539576
dish = 'dairy milk'
state = 'Berlin'
// returns multiple outputs in a line
console.table([roll, dish, state, shizuka])
console.log(state)
// Hitesh Chaudhary Class - 5
"use strict"; // this will treat all the js code as a new versions
// nowadays engines smart enough to recognise all these stuff, so can ignore
// there's nothing as no/don't use strict
//checking connectivity
alert("It's just pracitce project so kindly ignore")
//runs in browser only
//code readibility is worse below
console.log("anything"); console.log("random")
//code readibility is best below
console.log("anything");
console.log("random")
console.log("Hello Let's Learn JavaScript");
const age=19;
console.log("Age is", age);
//Array using let
let arr=[12,14,16,18,20];
console.log(arr[1]);
//Array using const
const arr1=[12,14,16,18,20];
console.log(arr[0]);
// Conditionals Statements
const $age=14;
if ($age<18){
console.log("Not Eligible!");
}
else{
console.log("Eligible!");
}
const yo = "You are special "