CSSUnparsedValue: entries() method

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("CSS Typed Object Model API")}} {{AvailableInWorkers}}

The **entries()** method of the {{domxref("CSSUnparsedValue")}} 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 value = new CSSUnparsedValue(["1em", "#445566", "-45px"]);

for (const [index, fragment] of value.entries()) {
  console.log(index, fragment);
}
// 0 "1em"
// 1 "#445566"
// 2 "-45px"

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

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