Skip to content

Instantly share code, notes, and snippets.

@cosinekitty
Created June 10, 2020 02:08
Show Gist options
  • Save cosinekitty/ac609ce7c83fcfe6a0d50fce8f7db152 to your computer and use it in GitHub Desktop.
Save cosinekitty/ac609ce7c83fcfe6a0d50fce8f7db152 to your computer and use it in GitHub Desktop.
function v(x) {
if (typeof x !== 'number') {
console.trace();
throw `Not a numeric type: ${x}`;
}
if (isNaN(x)) {
console.trace();
throw 'NAN result';
}
return x;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment