👻 Check our latest review to choose the best laptop for Machine Learning engineers and Deep learning tasks!
Objects contain keys and values. Sometimes you just want to get the values ‚Äã‚Äãback into the object. Suppose we have an object that stores the names of all the people in a collation. You may want to retrieve only the names of the object rather than the keys associated with their name (for example their locations).
is where the Object.values ‚Äã‚Äã() method comes in. This method allows you to see all the values ‚Äã‚Äãin an object. In this guide, we will discuss how to use the Object.values ‚Äã‚Äã() method. We’ll refer to a detailed example method to get you started.
Let’s take a look at the syntax of this method:.
The Object.values ‚Äã‚Äã() method takes one argument: the name of the object whose values you want to see. In this syntax, we display the result of the method on the console.
Note that the values ‚Äã‚Äãare in the same order they were in the dictionary.