Skip to content

Commit c1bf59b

Browse files
committed
config
1 parent 5fc1a84 commit c1bf59b

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

js_basics/datatypes.js

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
11
"use strict" //this line means trat all js code as newwer version
2-
//code readeabilty should be high
2+
//code readeabilty should be high
3+
4+
5+
//two types of datatypes 1-> primitive 2-> NOn-primitive
6+
7+
// 7 types of primitive
8+
//string boolean number null undefined symbol BigInt
9+
10+
11+
// JavaScript is a dynamically typed language. This means that variable types are determined at runtime, and you do not need to explicitly declare the type of a variable before using it. You can assign different types of values to a variable during its lifetime.
12+
13+
// For example, in JavaScript, you can do the following:
14+
15+
// let x = 10; // x is now a number
16+
// x = "Hello"; // x is now a string
17+
// x = true; // x is now a boolean
18+
// On the other hand, statically typed languages require you to declare the variable's type explicitly, and the type checking is done at compile-time, before the code is executed.
19+
20+
21+
//non primitive=== reference
22+
//Array objects functions
23+
24+
// Return type of variables in JavaScript
25+
// 1) Primitive Datatypes
26+
// Number => number
27+
// String => string
28+
// Boolean => boolean
29+
// null => object
30+
// undefined => undefined
31+
// Symbol => symbol
32+
// BigInt => bigint
33+
34+
// 2) Non-primitive Datatypes
35+
// Arrays => object
36+
// Function => function
37+
// Object => object

0 commit comments

Comments
 (0)