Skip to content

Instantly share code, notes, and snippets.

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