Object.values() JavaScript

The Javascript Object values() method retrieves an array of direct enumerable property values.

Syntax:

Object.values(object)

Parameters: object: It represents the object whose enumerable property values have to be retrieved.

Return: An array of direct enumerable property values.

Example:

<!DOCTYPE html>
<html>
<body>
<script>
const obj = { a: 'TOM', b: 'JONAS' };
document.write(Object.values(obj));
</script>
</body>
</html>
Please follow and like us:
Content Protection by DMCA.com