Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since May 2022.
The is() method of the Exception object can be used to test if the Exception matches a given tag.
The method might be used to test that a tag is correct before passing it to Exception.prototype.getArg() to get the passed values. It can be used on tags created in JavaScript and those created in WebAssembly code and exported to JavaScript.
A WebAssembly.Tag that can be checked to verify the type of the exception.
A boolean value — true if the specified tag matches the exception, and false otherwise.
To return true, it is not enough for the tag to have an identical sequence of data types — it must have the same identity (be the same tag) as was used to create the exception.
The code below shows how to use is() to verify that a tag matches an Exception.
This will log Tag1: true to the console.
We can also demonstrate that this exception will not match another tag even if the tag is created with the same parameters.
This will log Tag2: false to the console.
For a full working example, see the throw instruction reference page.
| WebAssembly JavaScript Interface: Exception Handling # dom-exception-is |
Enable JavaScript to view this browser compatibility table.
This page was last modified on May 22, 2026 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.