Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Read WebAssembly Memory from JavaScript

    javascriptJavaScript

    We use an offset exporting function to get the address of a string in WebAssembly memory. We then create a typed array on top of the WebAssembly memory representing the raw string data, and decode that into a JavaScript string.

    WASM Fiddle: https://wasdk.github.io/WasmFiddle/?6wzgh

    Demo Repo: https://github.com/guybedford/wasm-intro