Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 420 Bytes

global-variables.md

File metadata and controls

15 lines (12 loc) · 420 Bytes

Global variables

Global variables in WebAssembly differ from local ones in that they can be mutable or constant and need to be initialized before use. They can also be imported from JS. Or they can be defined like so:

(global $pointer (mut i32) (i32.const 0))
(func $usePointer
  global.get $pointer
  call $doSomething
)

source