JavaScript Getting Started With ES2015 Defining Variables With let and const Review let and const

Sorin Chircu
Sorin Chircu
34,845 Points

You have a mistake in variable "minutesInSecond = 60 "

just grammatical mistake

2 Answers

Kevin Gates
Kevin Gates
14,711 Points

Ah, found the quiz. Okay, so they're asking how do you declare the variables.

function secondsWorked(hours);
  ____ totalTime;
  ____ minutesInHour = 60;
  ____ minutesInSecond = 60;
  totalTime =  hours * minutesInHour * minutesInSecond; 
}
console.log( secondsWorked(40) );

So you were learning about let and const.

So you need to think:

  • Will "totalTime" ever change? If so, is that Let or Const?
  • Will "minutesInHour " ever change? If so, is that Let or Const?
  • Will "minutesInSecond " ever change? If so, is that Let or Const?

I just took the quiz and it works as expected.

Kevin Gates
Kevin Gates
14,711 Points

What is your question?