Ensure


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, jQuery v1.11.0 (available as $)
 
 


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