Skip to content

Instantly share code, notes, and snippets.

@goofmint

goofmint/index.js

Created Mar 21, 2019
Embed
What would you like to do?
sayHello(index) {
const length = mem.getUint32(index,true);
const array = new Uint16Array(mem.buffer,index + 4,length);
const str = new TextDecoder('utf-16').decode(array);
console.log(`Hello ${str}, from WebAssembly!`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.