Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2017年10月.
get() は WebAssembly.Table オブジェクトのプロトタイプメソッドで、指定された位置に格納されている関数参照を取得します。
取得する関数参照の位置です。
関数参照を返します。これはエクスポートされた WebAssembly 関数、wasm 関数を内在する JavaScript ラッパーです。
index が Table.prototype.length 以上であった場合、RangeError が発生します。
次の例では (Github の table.html と動作例も確認してください)、 table.wasm バイトコードを WebAssembly.instantiateStreaming() メソッドを使用して読み取り、コンパイルしてインスタンス化しています。その後、エクスポートされたテーブルに格納された参照を取得します。
参照に格納されている値を実際に取得するためには、アクセサーの最後に 2 つ目の関数呼び出し演算子を含める必要があります (get(0) ではなく get(0)())。これは単純な値ではなく、関数です。
| WebAssembly JavaScript Interface # dom-table-get |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年3月21日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.