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-3 §9.2. This function can not fail and the return value is always the boolean conversion of the argument.