JSFiddle - React, Tailwind, and code Playground

by Alexander

Babel + JSX

/*
function foo(arg1) {
  if (arguments.length < 1 || arg1 === undefined)
    throw new Error('Missing parameters');
  return arg1 + 2;
}
//*/

/*
function required(i) { throw new Error(`Missing ${i} parameter`) }

function foo(arg1 = required(1)) {
  return arg1 + 2;
}
//*/

console.log( foo() );