const tbl = new WebAssembly.Table({ initial: 2, element: "anyfunc" });
console.log(tbl.length);
console.log(tbl.get(0));
console.log(tbl.get(1));WebAssembly.Table.prototype.set() / notebook
WebAssembly.Table.prototype.set()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const importObj = {
js: { tbl },
};WebAssembly.instantiateStreaming(fetch("table2.wasm"), importObject).then(
(obj) => {
console.log(tbl.length);
console.log(tbl.get(0)());
console.log(tbl.get(1)());
},
);