MDN self-hosted library · e01.org
Truthy / notebook

Truthy

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
if (true);
if ({});
if ([]);
if (42);
if ("0");
if ("false");
if (new Date());
if (-42);
if (12n);
if (3.14);
if (-3.14);
if (Infinity);
if (-Infinity);
js
true && "dog";
// returns "dog"

[] && "dog";
// returns "dog"