How to Use Object.keys in JavaScript

Consider an object: var user = { name: “Jagathish”, age: 20} In the user object, the name and age are the keys of the object. Keys are also referred to as object β€œproperties”. We can access the property value by obj.propertyName or obj[propertyName]. The Object.keys() method returns an array of strings of a given object’s …

Design a site like this with WordPress.com
Get started