CodesJava

Easy learning with example program codes

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>

Output:

TOM,JONAS
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status