What is pass by Value and Pass by reference in JavaScript
Pass by value works with primitive data type
let a = 5;
let b = a;
b= b+5;
console.log(a);//5
console.log(b);//10
Pass by Refnrece Used in non Primitve::
const obj1 = {
user:"jigar",
pass:"pass"
}
const obj2= obj1;
obj2.pass = 'dd';
console.log(obj1);//{user: 'jigar', pass: 'dd'}
console.log(obj2);//{user: 'jigar', pass: 'dd'}