> For the complete documentation index, see [llms.txt](https://augustus-pash.gitbook.io/wasm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://augustus-pash.gitbook.io/wasm/types/globals.md).

# Globals

### Global

```javascript
// define global
(global $g (mut i32) (i32.const 0))
  
// get global
(get_global $g)

// set global
(set_global $g (i32.const 10))
```

### Global Import Example

```javascript
const global = new WebAssembly.Global({value:'i32', mutable:true}, 0);

var importObject = { js: { global: global} };

WebAssembly.instantiate(wasmModule.toBinary({}).buffer, importObject).then(function(res) {
    
  });
```

```javascript
// import
(global $g (import "js" "global") (mut i32))
```
