Call a JavaScript Function from WebAssembly

Share this video with your friends

Send Tweet

Using WASM Fiddle, we show how to write a simple number logger function that calls a consoleLog function defined in JavaScript. We then download and run the same function in a local project.

WASM Fiddle: https://wasdk.github.io/WasmFiddle/?cvrmt

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

Fyodr
Fyodr
~ 7 years ago

Hi, I'm quite new to C. Why is consoleLog treated as an import while our other function becomes an export? Is it because we used consoleLog inside of another function? And/or because we didn't "finish" declaring it? Thanks.