JavaScript JavaScript Numbers Working with Numbers Create a Program with Math

Clare Yeadon
Clare Yeadon
5,339 Points

Code not working

Hello, when I run the code below the console is only showing "There are ${SecsPerDay} seconds in a day." Also, I am trying to learn how to use Markdown.

const secsPerMin = 60;
const MinPerHour = 60;
const HourPerDay = 24;
const DayPerWeek = 7;
const WeekPerYear = 52;

const SecsPerDay = secsPerMin * MinPerHour * HourPerDay;

console.log('There are ${SecsPerDay} seconds in a day.');

3 Answers

connor ingold
connor ingold
5,380 Points

Use backticks instead of quotation marks ' '

Craig Britton
seal-mask
.a{fill-rule:evenodd;}techdegree
Craig Britton
Full Stack JavaScript Techdegree Student 1,452 Points
const secsPerMin = 60;
const minsPerHour = 60;
const hoursPerDay = 24;
const daysPerWeek = 7;
const weeksPerYear = 52;


const secsPerday = secsPerMin * minsPerHour * hoursPerDay;
const hoursPerWeek = hoursPerDay * daysPerWeek;
const minsInYear = minsPerHour * hoursPerDay * weeksPerYear;


console.log(`There are ${secsPerday} seconds in a day.`);
console.log(`There are ${hoursPerWeek} hours in a week.`);
console.log(`There are ${minsInYear} minutes in a year.`);

const yearsAlive = 28 * weeksPerYear;
const secsAlive = secsPerday * daysPerWeek * yearsAlive;
console.log(`I've been alive for more than ${secsAlive} seconds!`);