GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

CSSUnparsedValue: keys() method

CSS Typed Object Model API

CSS Typed Object Model API

The **`keys()`** method of the 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](/docs/Web/JavaScript/Reference/Global_Objects/Iterator).

## Examples

### Iterating over indexes

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

for (const index of value.keys()) {
console.log(index);
}
// 0
// 1
// 2
```

## Specifications

## Browser compatibility

## See also

- CSSUnparsedValue()
- CSSUnparsedValue.entries()
- CSSUnparsedValue.forEach()
- CSSUnparsedValue.length
- CSSUnparsedValue.values()
- [Using the CSS Typed OM](/docs/Web/API/CSS_Typed_OM_API/Guide)
- [CSS Typed Object Model API](/docs/Web/API/CSS_Typed_OM_API)

source: MDN Web Docs mirror · page

Cite this

"CSSUnparsedValue: keys() method". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/CSSUnparsedValue/keys

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·