Contents

toBool()

Converts the JavaScript value to a native Boolean value.

Declaration

func toBool() -> Bool

Return Value

The native Boolean value.

Discussion

This method uses JavaScript type coercion to convert the value to a JavaScript Boolean value, then returns the native representation of the result. Thus, this method can return true even when the isBoolean property does not.

See Also

Reading and Converting JavaScript Values