Object values() Method
Object.values() is a method that returns an array of values from an object, useful for extracting and processing object property values during iteration and manipulation.
Syntax:
Object.values( obj )
Example: In this example Object.values() extracts values from person object.
Javascript
let person = { name: "Nikita" , age: 21, city: "Noida" }; let result = Object.values(person); console.log(result); |
[ 'Nikita', 21, 'Noida' ]
JS 2017 – ECMAScript 2017
JavaScript (JS) 2017, or ECMAScript 2017, introduced some new features in JavaScript. It enhanced asynchronous programming with async functions, provided shared memory and atomics for improved concurrency, and introduced Object.values() and Object.entries() for streamlined object manipulation. These additions expanded JavaScript’s capabilities, making it more versatile and powerful for modern development.
JavaScript (JS) 2017 new features are:
- String padding
- Object entries() Method
- Object values() Method
- async and await
- Object.getOwnPropertyDescriptors
We will explore all the above methods along with their basic implementation with the help of examples.
Contact Us