10 Important Thing in JavaScript.

Primitives

Primitives data types are known as being immutable data types because there is no way to change a primitive value that is created.

var text1 = 'This is a text.';
text[1] = 'T'
console.log(text) // 'This is a text.'
var value1= 5;
var value2= 5;
value1=== value2; // truevar
text1 = 'This is a text.';
var text2 = 'This is a text.';
text1 === text2; // true

Non-primitive

Mutable data types are called Non-primitive. where value can change. follow the example are below:

var arr = [ 'one', 'two', 'three', 'four', 'five' ];
arr[1] = 'TWO';
console.log(arr) // [ 'one', 'TWO', 'three', 'four', 'five' ];

objects are not analyzed by esteem. This implies that regardless of whether two articles have similar properties and qualities, they are not carefully equivalent. The same goes for exhibits. Regardless of whether they have similar components that are in a similar request, they are not carefully equivalent.

var obj1 = { 'bats': 'player' };
var obj2 = { 'bats': 'player' };
obj1 === obj2; // falsevar
arr1 = [ 1, 2, 3, 4, 5];

--

--

Nahid Murad Abir

Web programmer, enthusiasts developer who always build new thing. learn new technology is a passion! Destination to be a good human!!