CSSNumericArray: keys() method
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("CSS Typed Object Model API")}} {{AvailableInWorkers}}
The **keys()** method of the {{domxref("CSSNumericArray")}} interface returns a new _array iterator_ that yields the index of each item in the object.
Syntax
js-nolint
keys()Parameters
None.
Return value
A new iterable iterator object.
Examples
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
// 2Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- {{domxref("CSSNumericArray.entries()")}}
- {{domxref("CSSNumericArray.forEach()")}}
- {{domxref("CSSNumericArray.length")}}
- {{domxref("CSSNumericArray.values()")}}
- Using the CSS Typed OM
- CSS Typed Object Model API