Skip to content

Bool ​

Bool is a type of object that represents a boolean value.

Create a bool ​

nv
let a = true;
let b = false;

Methods ​

to_string ​

Convert a bool to a string.

nv
let a = true;
a.to_string();
// "true"

to_number ​

Convert a bool to a number.

nv
let a = true;
a.to_number();
// 1

a = false;
a.to_number();
// 0