10 Days of JavaScript Day 3: Arrays, Try Catch and Finally & Throw

Featured image

Day 3 of 10 Days of JavaScript challenge on Hackerrank is Arrays, Try Catch and Finally & Throw. In this series, I will be sharing my solutions to the challenges.

Day 3: Arrays

Day 3: Try, Catch, and Finally

Day 3: Throw

Complete the isPositive function below. It has one integer parameter, a. If the value of a is positive, it must return the string YES. Otherwise, it must throw an Error according to the following rules: