Vue · Junior · Question 59 of 75

How do you iterate over an object's properties?

<li v-for="(value, key) in user" :key="key">{{ key }}: {{ value }}</li>

Explanation

A third alias gives the index: (value, key, index). The order follows Object.keys().

Further reading

Problem with a question

Vue · Junior · question 59

Test yourself

Take the Vue · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz