Data types

In JS, Variables don’t have type- Values have types 😎

<aside> πŸ’‘ To know the datatype, of x typeof x

</aside>

Strings

let str="Hello";
console.log(str);
console.log(str[1]);
console.log(str.charAt(1));
console.log(typeof str);

Untitled

Objects:

let obj={
    name: "Abc",
    age: 11
}
console.log(obj);
console.log(typeof obj);

Untitled

Array:

let arr=[1,2,3,4,5];
console.log(arr);
console.log(arr[0]);
console.log(typeof arr);

Untitled

Functions:

function fun(where){
    console.log("Function is called "+where);
}
fun("Here");
console.log(typeof fun);

Untitled

Mutability & Immutability

<aside> πŸ’‘ All Permeative data types are immutable in JavaScript

</aside>