CSSNumericArray: entries() method
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("CSS Typed Object Model API")}} {{AvailableInWorkers}}
The **entries()** method of the {{domxref("CSSNumericArray")}} interface returns a new _array iterator_ that yields [index, value] pairs for each item in the object.
Syntax
js-nolint
entries()Parameters
None.
Return value
A new iterable iterator object.
Examples
Iterating over index/value pairs
js
const sum = new CSSMathSum(CSS.px(10), CSS.em(5), CSS.percent(50));
for (const [index, value] of sum.values.entries()) {
console.log(index, value.toString());
}
// 0 "10px"
// 1 "5em"
// 2 "50%"Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- {{domxref("CSSNumericArray.forEach()")}}
- {{domxref("CSSNumericArray.keys()")}}
- {{domxref("CSSNumericArray.length")}}
- {{domxref("CSSNumericArray.values()")}}
- Using the CSS Typed OM
- CSS Typed Object Model API