JS::ToBoolean

This article covers features introduced in SpiderMonkey 17

Convert any JavaScript value to a boolean.

Syntax

bool
JS::ToBoolean(JS::HandleValue v)
Name Type Description
v JS::HandleValue The value to convert.

Description

JS::ToBoolean converts a JavaScript value to a boolean. It implements the ToBoolean operation described in ECMA 262 §7.1.2.This function can not fail and the return value is always the boolean conversion of the argument.

Document Tags and Contributors

Contributors to this page: mdnwebdocs-bot, nakhodkiin, teoli, arai, evilpie
Last updated by: mdnwebdocs-bot,