Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialVahe Gharagiozyan
10,088 PointsHere is what i got, seems to be working.
let name = prompt("What is your name?");
let age = prompt("What is your age?");
const secondsPerMin = 60;
const minutesPerHour = 60;
const hoursPerDay = 24;
const daysPerYear = 365;
const eightyFiveYears = 2680560000;
const secondsAlive = secondsPerMin * minutesPerHour * hoursPerDay * daysPerYear * parseInt(age);
let secondsTo85 = eightyFiveYears - secondsAlive;
alert(`Hello my name is ${name}, i have been alive for ${secondsAlive} seconds and i have ${secondsTo85} seconds remaining to reach 85 years old!`);
3 Answers
Vahe Gharagiozyan
10,088 PointsHello Curtis, good catch. The back tiks are there but its just not showing for some reason. When i click edit post i see them but not in the final posting. But you are definitely right its not showing for some reason.
Curtis Reker
Full Stack JavaScript Techdegree Student 4,607 Points//on a side note do you know how to format your post as a javascript?
// three back tiks and then javascript then the text then three more back tiks
//so like this
//```javascript
// code goes here
//```
let name = prompt("What is your name?"); let age = prompt("What is your age?");
const secondsPerMin = 60; const minutesPerHour = 60; const hoursPerDay = 24; const daysPerYear = 365; const eightyFiveYears = 2680560000; const secondsAlive = secondsPerMin * minutesPerHour * hoursPerDay * daysPerYear * parseInt(age); let secondsTo85 = eightyFiveYears - secondsAlive;
alert(`Hello my name is ${name}, i have been alive for ${secondsAlive} seconds and i have ${secondsTo85} seconds remaining to reach 85 years old!`);
Vahe Gharagiozyan
10,088 PointsAwesome it looks a lot better now, Thank you!
Curtis Reker
Full Stack JavaScript Techdegree Student 4,607 Pointsyou bet, trying to solidify my learning by answering questions! Cheers mate
Vahe Gharagiozyan
10,088 PointsYour doing great. Cheers brother.
Curtis Reker
Full Stack JavaScript Techdegree Student 4,607 PointsCurtis Reker
Full Stack JavaScript Techdegree Student 4,607 PointsLooks like your missing the back ticks around your alert statement