Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created March 21, 2019 13:17
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