Functions (Quiz)

In Getting Started with JavaScript’s lesson ( Functions >> Quiz)
There is a question:

What will this code print to the console?

const sleepTimer = (alarm) => {
  console.log('My alarm is set for: ' + alarm);
}

sleepTimer('8:30AM');

Why condition(alarm) put in parenthesis?!

Knowing that what I learned through the lesson is that the correct anatomy is

const sleepTimer = alarm => {
  console.log('My alarm is set for: ' + alarm);
}

sleepTimer('8:30AM');

Because both are correct.

With a single parameter, you may omit the parenthesis. Or keep them, up to you :wink:

2 Likes