The ECMAScript Boolean constructor works in SSJS. Called as a function, Boolean(value) performs correct truthiness coercion. The boxed new Boolean(value) object form also works, but the SFMC Jint engine stringifies a boxed boolean with a capitalized first letter (True / False) instead of the spec’s lowercase, and .valueOf() on a boxed instance does not return a clean primitive in every path. Prefer the function-call coercion form Boolean(value) (or !!value) and avoid boxed booleans.

Status legend

Icon Meaning
✅ Works Available and behaves as expected
⚠️ Partial Available but with a documented caveat or bug
❌ Missing Not available (or undefined) — use the workaround

Members

Member ES Status Notes
Boolean(value) ES3 ✅ Works Truthiness coercion — returns a primitive boolean
new Boolean(value) ES3 ⚠️ Partial Boxed object; String() yields capitalized True/False

<svg width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true">
  <circle cx="6" cy="6" r="4.5" stroke="currentColor" stroke-width="1.2"/>
  <path d="M6 3.5v3" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
  <path d="M6 8.3v.2" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
</svg>

Pending   </span>

</span> | | Boolean.prototype | ES3 | ✅ Works | toString / valueOf present on the prototype |


Boolean(value) — coercion

(ES3) — ✅ Works. Called as a plain function, Boolean(value) returns a primitive boolean reflecting the value’s truthiness.

Boolean(1);     // true
Boolean(0);     // false
Boolean("");    // false
Boolean("x");   // true
typeof Boolean(1);   // "boolean"

new Boolean(value) — boxed object

(ES3) — ⚠️ Partial.

<svg width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true">
  <circle cx="6" cy="6" r="4.5" stroke="currentColor" stroke-width="1.2"/>
  <path d="M6 3.5v3" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
  <path d="M6 8.3v.2" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
</svg>

Pending   </span>

</span> new Boolean(value) creates a boxed Boolean object (typeof is "object"). In the SFMC Jint engine its string form is capitalizedString(new Boolean(true)) is "True", not the spec’s "true". As in all JavaScript, a boxed boolean is always truthy in a condition (even new Boolean(false)), so this form is a footgun. Use Boolean(value) or !!value instead.

var b = new Boolean(true);
typeof b;               // "object"
String(new Boolean(true));    // "True" in SFMC (spec: "true")
String(new Boolean(false));   // "False" in SFMC (spec: "false")
// if (new Boolean(false)) { ... }  // truthy! — avoid boxed booleans

Boolean.prototype

(ES3) — ✅ Works. Boolean.prototype exists and exposes toString and valueOf.

typeof Boolean.prototype;            // "object"
typeof Boolean.prototype.toString;   // "function"
typeof Boolean.prototype.valueOf;    // "function"

See Also