-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconversionOperation.js
57 lines (39 loc) · 1.16 KB
/
conversionOperation.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
let score=null
// console.log(typeof score);
// console.log(typeof(score));
let valueInNumber=Number(score)
// console.log(typeof valueInNumber);
// console.log(valueInNumber);
//"33"=>33
//"33abc"=>NaN (but type-number)
//true=>1; false=>0
let isLoggedIn="sanjh"
let booleamIsLoggedIn=Boolean(isLoggedIn)
// console.log(booleamIsLoggedIn);
//1 => true; 0 => false
//"" => false
//"sanjh" => true
let someNumber=33
let numToString=String(someNumber);
// console.log(numToString);
// console.log(typeof numToString);
//************************Operations********************************/
let value=3;
let negValue=-value;
// console.log(negValue);
let str1="Sanjh"
let str2=" singh"
// console.log(str1+str2);
// console.log(1+"2");
// console.log("1"+2);
// console.log("1"+2+2); after string number convert into string
// console.log(1+2+"2");
// console.log(+true);
// console.log(+"");
// let num1,num2,num3
// num1=num2=num3=2+2
let gameCounter=100
++gameCounter;
console.log(gameCounter);
// https://tc39.es/ecma262/multipage/abstract-operations.html#sec-abstract-operations
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Increment