-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirst.js
More file actions
86 lines (73 loc) Β· 1.87 KB
/
Copy pathfirst.js
File metadata and controls
86 lines (73 loc) Β· 1.87 KB
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
// console
console.log("RCB - IPL 2026 Champion");
console.log("RCB - IPL 2025 Champion");
console.log("Adarsh Mishra");
console.warn("This is warning")
console.error("This is an error")
// variable
King = "Virat Kohli";
console.log(King);
HighestScore = 973;
console.log(HighestScore);
Duck = null;
console.log(Duck);
RetirementYear = undefined;
console.log(RetirementYear);
Choker = false;
console.log(Choker);
fan1 = "Adarsh";
console.log(fan1);
// let,var and const
var age1 = 21; // can be re-declared or update
let age2 = 22; // cannot be re-declared but can be update
const age3 = 23; // cannot be re-declared or update
console.log(age1);
let age4;
age4 = 10;
console.log(age4);
var age5 = 17;
{
let age5 = 15;
console.log(age5);
}
age5 = 16;
console.log(age5);
// data types - Primitive
console.log(typeof(age1));
console.log(typeof(King));
console.log(typeof(Choker));
console.log(typeof(RetirementYear));
console.log(typeof(Duck));
let x = BigInt("100");
console.log(x);
console.log(typeof(x));
let y = Symbol("RCB");
console.log(y);
console.log(typeof(y));
// DataTypes - Nonprimitive
//1.Object,2.Array,3.Function
// object
const team = {
name : "RCB",
captian : "Rajat Patidar",
championYear : 2025,
trophy : 1,
fighter : true,
fanbase : 1000000000000000
}
console.log(team);
console.log(typeof(team));
console.log("Captian = ",team.captian);
console.log("Captian = ",team["captian"]);
team.captian = "Virat Kohli";
console.log("Captian = ",team.captian);
team["captian"] = "Faf du plesis";
console.log("Captian = ",team.captian);
//Some useful keywords
console.log("Adarsh") //for message
console.warn("Be aware") //for warning
console.error("I am error") //for intentional error
alert("This is only for adult!") //for alert popup block msg
confirm("Are you an adult?") //for confirmation
let a = prompt("Enter your name: ")
console.log(`Username is : ${a}`)