0% found this document useful (0 votes)
2 views2 pages

JavaScript Objects Arrays Notes

The lecture notes cover key concepts related to JavaScript objects and arrays, including CRUD operations, destructuring, and the use of the rest and spread operators. It explains the differences between sealing and freezing objects, as well as shallow and deep copying techniques. Additionally, it highlights the reference type nature of objects and arrays and provides insights into iterating over object keys using the for...in loop.

Uploaded by

khannashit627
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

JavaScript Objects Arrays Notes

The lecture notes cover key concepts related to JavaScript objects and arrays, including CRUD operations, destructuring, and the use of the rest and spread operators. It explains the differences between sealing and freezing objects, as well as shallow and deep copying techniques. Additionally, it highlights the reference type nature of objects and arrays and provides insights into iterating over object keys using the for...in loop.

Uploaded by

khannashit627
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JavaScript Objects & Arrays - Lecture Notes

Compiled from the lecture transcript shared in chat.

Topics Covered
• Objects and CRUD Operations
• Objects with Functions
• Arrays as Special Objects
• const, let, var with Objects
• [Link]() and [Link]()
• Array vs Object
• Destructuring (Array & Object)
• Rest Operator and Spread Operator
• Reference Types
• Shallow Copy vs Deep Copy
• [Link]() and [Link]()
• structuredClone()
• for...in Loop
1. Arrays are Special Objects
JavaScript me arrays internally objects hote hain. Difference sirf itna hai ki arrays numeric keys
(0,1,2,3...) use karte hain jabki normal objects named keys use karte hain.

2. [Link]()
Seal karne ke baad existing properties update ho sakti hain, lekin new properties add ya delete nahi
kar sakte.

3. [Link]()
Freeze ke baad object completely locked ho jata hai. Create, Update, Delete kuch bhi nahi kar
sakte.

4. Destructuring
Array destructuring position ke basis par hoti hai. Object destructuring property names ke basis par
hoti hai.

5. Rest Operator (...)


Destructuring ke waqt bachi hui values ko collect karta hai.

6. Spread Operator (...)


Arrays aur objects ko spread/copy karne ke liye use hota hai.

7. Reference Type
Objects aur arrays reference type hote hain. Direct assignment me dono variables same memory
location ko point karte hain.

8. Shallow Copy
Spread operator se copy banane par nested objects/arrays ka reference share ho sakta hai.

9. Deep Copy
[Link]([Link](obj)) ya structuredClone() use karke complete independent copy
banayi ja sakti hai.

10. for...in Loop


Object ki keys iterate karne ke liye use hota hai. Values access karne ke liye obj[key] use karte
hain.

You might also like