DEV Community

loading...

Discussion on: Daily Challenge #302 - setAlarm

Collapse
mellen profile image
Matt Ellen

Enjoy!

function setAlarm()
{
  if((typeof arguments[0]) == 'boolean')
  {
    let [first, second] = arguments;
    return first && setAlarm(second===null?second:!second, null);
  }
  return true;
}
Enter fullscreen mode Exit fullscreen mode