CSSNumericArray: keys() method

Note: This feature is available in Web Workers.

The keys() method of the CSSNumericArray interface returns a new array iterator that yields the index of each item in the object.

Syntax

js
keys()

Parameters

None.

Return value

A new iterable iterator.

Examples

undefined

Iterating over indexes

js
const sum = new CSSMathSum(CSS.px(10), CSS.em(5), CSS.percent(50));

for (const index of sum.values.keys()) {
  console.log(index);
}
// 0
// 1
// 2

Specifications

See also