Array.prototype.values() - JavaScript | MDN

developer.mozilla.org

MDN | MDN Curriculum | Playground | HTTP Observatory | About MDN | Advertise with us | Community | Blog | MDN Plus | MDN Discord | HTML: Markup language | Elements | Global attributes | Attributes | See all… | Responsive images | HTML cheatsheet | Date & time formats | See all… | SVG | MathML | XML | CSS: Styling language | Properties | Selectors | At-rules | Values | See all…

Tin mới

HTML: Markup language

See all HTML references

Date & time formats

See all HTML guides

CSS: Styling language

See all CSS references

See all CSS guides

Centering an element

JavaScript: Scripting language

Standard built-in objects

Expressions & operators

Statements & declarations

See all JavaScript references

Control flow & error handing

Loops and iteration

Working with objects

See all JavaScript guides

Web APIs: Programming interfaces

Service worker API

Using the Web animation API

Using the Fetch API

Working with the History API

Using the Web speech API

All web technology

Progressive web apps

Learn web development

Getting started modules

Structuring content with HTML module

CSS styling basics module

Dynamic scripting with JavaScript module

Border-image generator

Border-radius generator

Box-shadow generator

Color format converter

iterable iterator object

Array.prototype[Symbol.iterator]()

Array.prototype.values() is the default implementation of Array.prototype[Symbol.iterator]().

Iteration using for...of loop

Because values() returns an iterable iterator, you can use a for...of loop to iterate it.

the for...of loop ends

Warning: The array iterator object should be a one-time use object. Do not reuse it.

Reusing the iterable

Warning: The array iterator object should be a one-time use object. Do not reuse it.

Mutations during iteration

There are no values stored in the array iterator object returned from values(); instead, it stores the address of the array used in its creation, and reads the currently visited index on each iteration. Therefore, its it

Indexed collections

Array.prototype.entries()

Array.prototype.keys()

TypedArray.prototype.values()

Learn how to contribute

This page was last modified on Jun 19, 2026 by MDN contributors.

[Symbol.unscopables]

[Symbol.hasInstance]()

__defineGetter__()

__defineSetter__()

__lookupGetter__()