CSSUnparsedValue: keys() method
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("CSS Typed Object Model API")}} {{AvailableInWorkers}}
The **keys()** method of the {{domxref("CSSUnparsedValue")}} 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 value = new CSSUnparsedValue(["1em", "#445566", "-45px"]);
for (const index of value.keys()) {
console.log(index);
}
// 0
// 1
// 2Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- {{domxref("CSSUnparsedValue.CSSUnparsedValue", "CSSUnparsedValue()")}}
- {{domxref("CSSUnparsedValue.entries()")}}
- {{domxref("CSSUnparsedValue.forEach()")}}
- {{domxref("CSSUnparsedValue.length")}}
- {{domxref("CSSUnparsedValue.values()")}}
- Using the CSS Typed OM
- CSS Typed Object Model API