(module

  (memory $memory 1)
  (export "memory" (memory $memory))

  (func (export "store_in_mem") (param $num i32)
    i32.const 0
    local.get $num

    ;; store $num at position 0
    i32.store
  )

)
var url = "{%wasm-url%}";
await WebAssembly.instantiateStreaming(fetch(url)).then(
  (result) => {
    const store_in_mem = result.instance.exports.store_in_mem;
    const memory = result.instance.exports.memory;

    store_in_mem(100);

    var dataView = new DataView(memory.buffer);
    var first_number_in_mem = dataView.getUint32(0, true);

    console.log(first_number_in_mem);
  }
);

Wat Demo: store