-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsession1.js
62 lines (47 loc) · 1.23 KB
/
session1.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
console.log('Hello World!');
console.error('This Is an eroor');
console.warn("Rhis is warning");
//https://developer.mozilla.org/en-US/docs/Web/API/console
// Variables
// var , let , const
// var is for globle
// let, const
let age = 20;
age = 19;
console.log(age);
const score = 20;
//score = 31; !!
console.error("Cant re assign the const variable");
let temp;
temp = 31;
console.log(temp);
//const age1; cant do that!!
// String, NUmbers, Boolean, Null, undefined
const name = 'Adarsh Pawar';
const age2 = 30;
const isCool = true;
const rating = 2.5;
const x = null;
const y = undefined;
let z;
null == undefined; //true
null === undefined; //false
this == window; // true
this === window; //true
console.log(typeof name);
console.log(typeof x);
console.log(typeof age2);
//Concatenation
console.log('My name is ' + name + ' and Im ' + age);
console.log(`My name is ${name} and I am ${age}`);
//String Oprations
const s = 'Hello World!!';
console.log(s.length);
console.log(s.toLocaleUpperCase());
console.log(s.substring(0, 5));
console.log(s.substring(0, 5).toLocaleLowerCase());
console.log(s.split(''));
const tech = 'technology, computers, IT, code';
console.log(tech.split(', '));
let te = tech.split(', ');
console.log(te.length);