WebAssembly.Tag.prototype.type()

The type() prototype method of the Tag object can be used to get the sequence of data types associated with the tag.

Syntax

type()

Parameters

None

Return value

An object with a property named parameters that references the array of data types associated with this Tag.

This is a copy of the type object that was originally passed into the Tag() constructor.

Examples

This code snippet creates a tag defining two data types and then exports them using type(). The result is printed to the console:

const tag = new WebAssembly.Tag({ parameters: ["i32", "i64"] });
console.log(tag.type());

// Console output:
// Object { parameters: (2) […] }
//   parameters: Array [ "i32", "i64" ]
//   <prototype>: Object { … }

Specifications

Specification
WebAssembly JavaScript Interface: Exception Handling
# dom-tag-type

Browser compatibility

BCD tables only load in the browser

See also