Add in WAST
Input
(module
(func $add (param i32) (param i32) (result i32)
(get_local 0)
(get_local 1)
(i32.add)
)
(export "add" (func $add))
)
Client
var code = document.getElementById("input").innerText;
var module = webassemblyjs.instantiateFromSource(code);
var res = module.exports.add(1, 1);
document.getElementById("res").innerHTML = res;
Result
...