Primitive Types & Reference Types
1. Introduction to JavaScript Types:
2. Primitive Types:
let a = 10;
let b = a;
a = 20;
console.log(a); // Output: 20
console.log(b); // Output: 103. Reference Types
let objA = { value: 10 };
let objB = objA;
objA.value = 20;
console.log(objA.value); // Output: 20
console.log(objB.value); // Output: 20
4. Copying Behavior:

5. Side Effects in Functions
6. Conclusion:
7. Takeaways:
Last updated