JSFiddle - React, Tailwind, and code Playground

by Dominic Myers

JavaScript

const thing  = "fred";

const helloWorld = () => {
    console.log("hello");
    console.log("world");
};

thing === "fred" && helloWorld(); // hello\nworld

thing === "Fred" && helloWorld(); // nowt

thing === "fred" && (() => {
    console.log("hello");
    console.log("world");
})();  // hello\nworld

thing === "Fred" && (() => {
    console.log("hello");
    console.log("world");
})();  // nowt

thing === "fred" ? helloWorld() : null;  // hello\nworld

thing === "Fred" ? helloWorld() : null;  // nowt