DAGDA SEARCH | Back to results | Support

WebAssembly.Global.prototype.valueOf() - WebAssembly | MDN

Source: https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/Global/valueOf

WebAssembly.Global.prototype.valueOf()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2020.

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

Syntax

js
valueOf()

Parameters

None.

Return value

A string indicating the value of the global.

Examples

Basic usage

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

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

Specifications

Specification
WebAssembly JavaScript Interface
# dom-global-valueof

Browser compatibility

See also

Help improve MDN

Was this page helpful to you? Yes No Learn how to contribute

This page was last modified on Apr 27, 2026 by MDN contributors.

View this page on GitHub • Report a problem with this content