Ensure


JavaScript Language Public

Easy  

3min

Modify the ensure function so that it throws an error if called without arguments or an argument is undefined. Otherwise it should return the given value.

ECMAScript 5.1
   

  •   No arguments: Wrong answer
  •   Truthy argument: Wrong answer
  •   Falsy argument: Wrong answer