-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasic.js
62 lines (46 loc) · 1.32 KB
/
basic.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
// console.log("Hello Savitaar!!!!")
// var a = 5
// console.log(a)
// var a = 10
// console.log(a)
// x = 5;
// y = 6;
// let z = x+y;
// console.log(z == (x+y))
// var name = 'Shashank'
// var insta = 'codewithsavitaar'
// console.log(`${name} has insta and youtube as ${insta}. Please Follow and Subscribe 🚀`)
// // Array with Square brackets[]
// const arr = [1,2,3,5,7,9,4,4,3,2,3,2]
// console.log(arr)
// // console.log([3,4,6,8,5]);
// // Object in Curly brackets {}
// console.log({name : "shashank" , age : 24});
// // Sets with brackets () removes duplicates
// const s1 = new Set(arr)
// console.log(s1)
// // Table
// console.table({Name : "shashank" , age : 24 , position: 'Application Developer', company: 'IBM'});
// console.warn("This is a warning");
// const d1 = new Date().getSeconds()
// // function
// const d2 = new Date().getSeconds()
// console.log("Time taken by code is", d2-d1)
// const age = 111
// console.assert(age>100 , "Dead/Failed")
// console.error('Error')
// // console.clear();
// var age = 41
// > , >=
// < , <=
// = , == , ===
// if(age<19){
// console.log("Teen")
// }
// else if(age>19 && age<=40){
// console.log("Adult")
// }
// else{
// console.log("Mid Age Adult")
// }
// age<19 ? console.log("Teen") : (19<age && age<40) ? console.log("Adult") : console.log("Mid age")