MDN self-hosted library · e01.org

WebAssembly.Global.prototype.valueOf()

The valueOf method of the WebAssembly.Global object prototype returns the value contained inside the global variable.

Open notebook · 1 cells webassembly-instance-method upstream source

The valueOf method of the WebAssembly.Global object prototype returns the value contained inside the global variable.

Syntax

valueOf()

Parameters

None.

Return value

A string indicating the value of the global.

Examples

Basic usage

const myGlobal = new WebAssembly.Global({ value: "i32", mutable: true }, 42);

// 42
console.log(myGlobal.valueOf());

Specifications

Browser compatibility

See also