Skip to content

Commit 0cf3b2a

Browse files
committed
datatype
1 parent dc0a9a7 commit 0cf3b2a

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

01_basics/01_datatypes.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// to treat all the old javascript codes essence according to the newer version use "strict"
2+
"use strict";
3+
4+
// alert(3+3) does not print 6 as this is nodejs. in brower's console if we write alert(6+6) it create brower's window object by executing alert function call in brower's js environment V8. then the dialog box is created and shows 12 and on pressing "ok" it closes.
5+
6+
console.log(6+6) //in node js it happens in this way
7+
8+
// Different datatypes :
9+
// number => range is upto 2^53
10+
// bigint => range more than number. generally used in big data or stock market.
11+
// boolean
12+
// string => represented in ""
13+
// null => an object to represnet empty values
14+
// undefined => represents no value in uninitialized variable
15+
16+
// object
17+
18+
// typeof gives the type of object
19+
20+
console.log(typeof "hello");
21+
22+
let num = 2^53 +1
23+
24+
console.log(typeof num);
25+
26+

0 commit comments

Comments
 (0)