Mozilla's getting a new look. What do you think? https://mzl.la/brandsurvey

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-3 §9.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: arai, evilpie
 Last updated by: arai,