Objects

In Java Script, one of the most used datatype is Object. It is used to store Properties or information of any object/item in for of key-value pairs.
There are two ways to create object in Java script:
To access properties of Objects, we either use dots(“.”) or Square brackets (“[]”):
The main reason behind using square brackets is that if the consist any space, then we will not be able to access that using dots, in that case we can use square brackets, but generally we use dots.
Now Some of the most useful methods available for objects are:
We use “.keys” to access all keys of any object:
And similarly, we can use “.value” to access all values of any object:
And we can also that is any property available on that object or not, using “hasOwnProperty” or “hasOwn”:
Hope you found reading this blog Helpful, make sure to hit on the like button if you found reading this blog helpful. Be Happy.
Subscribe to my newsletter
Read articles from Manish Saw directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
