- Home
- /
- Tutorials
- /
- JavaScript Tutorial
- /
- JavaScript Object keys and values
JavaScript Objects
JavaScript Object keys and values
Object.keys,Object.valuesandObject.entriesturn an object into arrays you can loop over.
Objects do not have array methods of their own.
These three functions bridge the gap, so you can use map, filter and the rest.
Example
Example
javascript
const person = { name: "Ada", age: 36 };
console.log(Object.keys(person).join(","));
console.log(Object.values(person).join(","));