WebAssembly.Table.prototype.length
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since October 2017.
Die schreibgeschützte length
Prototypeigenschaft des WebAssembly.Table
-Objekts gibt die Länge der Tabelle zurück, d.h. die Anzahl der Elemente in der Tabelle.
Beispiele
Verwendung von length
Das folgende Beispiel erstellt eine neue WebAssembly-Tabelle mit einer anfänglichen Größe von 2 und einer maximalen Größe von 10:
js
const table = new WebAssembly.Table({
element: "anyfunc",
initial: 2,
maximum: 10,
});
Erweitern Sie die Tabelle um 1 mit WebAssembly.grow()
:
js
console.log(table.length); // 2
table.grow(1);
console.log(table.length); // 3
Spezifikationen
Specification |
---|
WebAssembly JavaScript Interface # dom-table-length |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
length |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Siehe auch
- WebAssembly Übersichtsseite
- WebAssembly-Konzepte
- Verwendung der WebAssembly JavaScript API