Skip to content

Instantly share code, notes, and snippets.

@codeperfectplus
Created September 10, 2023 14:46
Show Gist options
  • Select an option

  • Save codeperfectplus/dca5d0c9a98133b3031e9e9cc7443fd7 to your computer and use it in GitHub Desktop.

Select an option

Save codeperfectplus/dca5d0c9a98133b3031e9e9cc7443fd7 to your computer and use it in GitHub Desktop.
function isPositive(a) {
if (a == 0) {
throw new Error("Zero Error");
}
if (a < 0) {
throw new Error("Negative Error");
}
return 'YES';
}
console.log(isPositive(-10))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment