StylePropertyMapReadOnly: entries() Methode

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Die StylePropertyMapReadOnly.entries()-Methode gibt ein Array mit den eigenen aufzählbaren [key, value]-Paaren eines gegebenen Objekts zurück, in derselben Reihenfolge wie sie in einer for...in-Schleife bereitgestellt werden (der Unterschied besteht darin, dass eine for-in-Schleife auch Eigenschaften in der Prototypenkette aufzählt).

Syntax

js
entries()

Parameter

Keine.

Rückgabewert

Ein Array der eigenen aufzählbaren [key, value]-Paare des gegebenen StylePropertyMapReadOnly-Objekts.

Beispiele

Hier wird ein Beispiel für die Verwendung der StylePropertyMapReadOnly.entries()-Methode auf den berechneten Stilen eines Elements gezeigt.

js
// grab a DOM element
const buttonEl = document.querySelector("button");

// we can retrieve all computed styles with `computedStyleMap`
const allComputedStyles = buttonEl.computedStyleMap();

// entries returns an iterable of the items
const iterableStyles = allComputedStyles.entries();

// returns a two item array with align-content as the first item and CSSStyleValue as the second
console.log(iterableStyles.next().value);

Spezifikationen

No specification found

No specification data found for api.StylePropertyMapReadOnly.entries.
Check for problems with this page or contribute a missing spec_url to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
entries

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.