How to get the Object values list in JavaScript

In this tutorial, we will learn about how to get values in the javascript Object.

Object.values( ) method is used to get the enumerable object property values as an array.

let colors = {
    black: "#00000",
    white: "#ffff",
    red: "#FF0000"


// ["#00000", "#ffff", "#FF0000"]

let  emails = {
    user1 : "",
    user2 : "",
    user3 : "",


// ["", "", ""]

Object.values() method takes the object as its first argument and returns the array of object values. The ordering of the values in an array are the same order present in the object.