JSFiddle - React, Tailwind, and code Playground

by David Kyle

HTML

<div class="output">

</div>

JavaScript

const strange = [
  "0",
  0,
  null,
  false,
  "false",
  1,
  "true",
  {},
  undefined,
  true,
  "1"
];

let myFunc = function() {
  let output = '';
  
  for (let i = 0; i < strange.length; i++) {
    output += `${strange[i]} = ${(!!strange[i])}<br />`;
  }
  
  return output;
}

document.getElementsByClassName("output")[0].innerHTML = `<span>${myFunc()}</span>`;