Many WebAssembly tutorials, including the example code on MDN, use a "console" "log"
import. I thought it would be good to add this import to the WasmRunner
used for the exercises to avoid confusion when people copy/paste example code into their Exercism exercise.
If you’re a WASM beginner (like me) you might not even realize that the "console" "log"
import has to be defined somewhere ahead of time.
WasmRunner
has plenty of alternative logging functions (including log_i32_u()
that is also just a console.log()
call) but it’s not obvious they exist if you don’t look into this source file (or, I just came across them, some Markdown documentation files that are not linked on the track, I think?)
Link to the PR: Add a general purpose console.log() import. by Terr · Pull Request #11 · exercism/wasm-lib · GitHub