Untitled

mail@pastecode.io avatar
unknown
plain_text
24 days ago
2.1 kB
1
Indexable
Never
// what we are going to study
// basic of js
// variables in js
// data types in js

// types of variables in js

// 1 - var
// 2 - let 
//  3 - const

// var type variable - bahut kam cases use krte hain

// var a = 3;
// a = 10;
// var a = 15;
// console.log(a)

// let b = 4;
// b= 10;

// let b = 16;
// console.log(b);

// const c = 5;
// c = 19;
// console.log(c);

// var
// 1 - variable can be used before intialisation;
// console.log(a)
// var a= 5;

// 2 - var type variable ki value udpate kar skte hain
// 3  - can create the same variable with the same name again

// let 
// 1- can not use variable before intialisation
// 2 - can update the value of variable
//  3- can not create the same variable with the same  name

// const 
// 1- can not use variable before intialisation
//  2- can not create the same variable with the same  name
// can not update the value of variable



// data types 

// the type of value assign to the variable is known as data type

// var a =  5; number
// var  b = 'abcd' string

// type of data types - 
// 1 - String
// 2 - Number
// 3 - Boolean
// 4 - Object
// {
//     a:"anjsn"
// }
// {
//     key:value
// }
// object are in the form of key value pairs

// 5 - null
// 6 - undefined
// 7 - Bigint 
// let a = BigInt(3355353535353535353535353535)
// 8 - Symbol 


// difference b/w c lanaguage and javascript
// 1 - js is loosely typed language 

// primitive and non-primitive data types 
// 1 - primitive data type - 
// a-  those data type which are provided by javascript is known as primitive 
// b - they have fixed size;
// example - string , Number , Boolean 

// 2 - Non - primitive data type -
// those data types which are created by user 
// example  - array , object , linked list

// call by value and call by reference
// let a  = 5 ; 
// let c = a;
// console.log(c == a)

// call by reference
// let c = [1,2,3,4];
// let d = c;
// console.log(c == d) true;
// console.log([1,2,3,4] == [1,2,3,4]) false
// console.log([1] == [1]) false
// console.log([] == []) false
Leave a Comment