Ensure


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

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