Array.prototype.values
returns an iterator for all values in the array
values()
returns an iterator
use iterator.next()
to drop first value
empty array contains no values
a sparse array without real values has values though
also includes holes in sparse arrays
Required Knowledge
- `const` declaration (Block scope)
- array (Destructuring)
- protocol (Iterator)
Related Katas
Array API
array.sort()
basicsarray.sort()
can take a compare functionarray.shift()
(as introduced in ES3)array.push()
(as introduced in ES3)Array.from()
Array.of()
array.fill()
array.find()
array.findIndex()
array.entries()
array.keys()
array.values()
array.includes()
array.toReversed()
Difficulty Level
INTERMEDIATE
First Published
20 May 2015
Stats
5 tests to solve