CSSUnparsedValue: 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("CSSUnparsedValue")}} interface returns the number of items in the object.

Value

An integer.

Examples

Basic usage

In this example, we use the {{domxref("CSSUnparsedValue.CSSUnparsedValue", "CSSUnparsedValue()")}} constructor, then query the length:

js
const value = new CSSUnparsedValue(["1em", "#445566", "-45px"]);

console.log(value.length); // 3

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("CSSUnparsedValue.CSSUnparsedValue", "CSSUnparsedValue()")}}
  • {{domxref("CSSUnparsedValue.entries()")}}
  • {{domxref("CSSUnparsedValue.forEach()")}}
  • {{domxref("CSSUnparsedValue.keys()")}}
  • {{domxref("CSSUnparsedValue.values()")}}
  • Using the CSS Typed OM
  • CSS Typed Object Model API