CSSNumericArray: length property
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("CSS Typed Object Model API")}} {{AvailableInWorkers}}
The **length** read-only property of the {{domxref("CSSNumericArray")}} interface returns the number of items in the object.
Value
An integer.
Examples
Basic usage
In this example, we read the length of the {{domxref("CSSNumericArray")}} returned by the values property of a {{domxref("CSSMathSum")}}:
js
const sum = new CSSMathSum(CSS.px(10), CSS.em(5), CSS.percent(50));
console.log(sum.values.length); // 3Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- {{domxref("CSSNumericArray.entries()")}}
- {{domxref("CSSNumericArray.forEach()")}}
- {{domxref("CSSNumericArray.keys()")}}
- {{domxref("CSSNumericArray.values()")}}
- Using the CSS Typed OM
- CSS Typed Object Model API