# How to loop through object values using Object.values() in JavaScript

By Atta Ur Rehman Shah (https://attacomsian.com/about). Published Sep 19, 2022. Topics: JavaScript.
Canonical URL: https://attacomsian.com/blog/javascript-iterate-object-using-object-values

> Learn how to use the Object.values() method to iterate over object values in JavaScript.

The [`Object.values()`](https://attacomsian.com/blog/object-entries-values-javascript#objectvalues-method) method was introduced in ES8 and it does the opposite of the [`Object.key()`](https://attacomsian.com/blog/javascript-iterate-object-using-object-keys) method. 

The `Object.values()` method returns the values of all properties in the object as an array. You can then loop through the values array by using any of the [array looping methods](https://attacomsian.com/blog/javascript-loops).

Here is an example:

```javascript
const animals = {
  tiger: '?',
  cat: '?',
  monkey: '?',
  elephant: '?'
}

// iterate over object values
Object.values(animals).forEach(val => console.log(val))

// ?
// ?
// ?
// ?
```

Read [this article](https://attacomsian.com/blog/javascript-iterate-objects) to learn more about different ways of iterating over an object in JavaScript.
