
Understanding Objects in JavaScript
Hello Readers 👋, Welcome to the 6th blog of this Javascript series . Imagine you are going to work, and you carry a backpack. That backpack contains your laptop, ID card, and a pen. Now imagine you have to carry all these items separately - laptop in one hand, ID card in your pocket, pen in another pocket. That would be messy, right? That is exactly why we need objects in JavaScript. Just like a backpack helps you organize your belongings in one place, an object helps you organize related information in one structure. What are Objects and Why Do We Need Them? In the previous blogs, we learned about variables and datatypes. We can create variables like this: let name = " Satya " let age = 25 let city = " Mumbai " let isStudent = false But what if we have to manage information for multiple people? let name1 = " Satya " let age1 = 25 let city1 = " Mumbai " let name2 = " Omm " let age2 = 22 let city2 = " Delhi " let name3 = " Priya " let age3 = 24 let city3 = " Bangalore " This becomes mes
Continue reading on Dev.to Webdev
Opens in a new tab


