Files
jsrt/lib/stdlib/boolean.js
T
2026-10-16 08:00:06 +00:00

11 lines
271 B
JavaScript

// Converts any value to a boolean, like the spec's ToBoolean
function Boolean(x) {
return !!x;
}
// In these methods `this` is the primitive boolean itself
Boolean.prototype = {
toString() { return this ? "true" : "false"; },
valueOf() { return this; },
};