How can we define Javascript code/functions from within Go code with Webassembly?
I want to do something similar as can be done in C with Emscripten:
#include <emscripten.h>
int main() {
EM_ASM(
alert('hello world!');
throw 'all done';
);
return 0;
}
Is there a similar function in Go to execute Javascript code?
Also in with EM_ASM() it is not possible to call defined JS functions from other places, I would like to also be able to define functions so they can be called multiple times. (as if they were just defined in a seperate js file).