Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

You have a mistake in variable "minutesInSecond = 60 "

just grammatical mistake

2 Answers

Kevin Gates
Kevin Gates
14,853 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,853 Points

What is your question?