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 trial
Andrew Gay
20,893 PointsJavaScript Foundations (Creating Numbers Part 2)
<h1>
/*SOLUTION*/
Remove All Comments within script -.-
</h1>
Exponential notation is as follows correct?
var GermanyGDP;
GermanyGDP = 34E11; //3.4Trillion
/*Along side I have input similar outputs*/
var GermanyGDP = 3.4E12;
var GermanyGDP = 34E11;
I have been stuck on this for quite some time and I am positive I am doing it correctly.
5 Answers
Ben Rubin
Courses Plus Student 14,658 PointsWhat you're doing looks correct. Are you putting your code in the <script> tag?
James Barnett
39,199 PointsAndrew Gay - I just pasted your code between the <script> tags in the code challenge and it passed just fine.
Andrew Gay
20,893 PointsI put the code between the script tags and it is still not completing the challenge
<!DOCTYPE html>
<html lang="en">
<head>
<title> JavaScript Foundations: Creating Numbers</title>
<link rel="stylesheet" href="core.css">
<script>
var GermanyGDP = 3.4E12; //3.4Trillion
// 1E6 === 1000000
// 1.23E6 === 1230000
// octal number literals
// 06 === 6
// 07 === 7
// 010 === 8
// 011 === 9
// 012 === 10
</script>
</head>
<body>
<h1>JavaScript Foundations</h1>
<h2>Creating Numbers: Part 2</h2>
<script src="viewer.js"></script>
</body>
</html>
James Barnett
39,199 PointsLooks like you found an actual bug in the code correctness check of the code challenge.
This works
var GermanyGDP = 3.4E12;
This doesn't
var GermanyGDP = 3.4E12; //3.4Trillion
Not sure who exactly on the dev team handles this, tagging Tommy Morgan & Jim Hoskins
Andrew Gay
20,893 PointsI usually declare all my variables then assign but the code challenge screen is a bit picky sometimes.
James Barnett
39,199 Points> I usually declare all my variables then assign but the code challenge screen is a bit picky sometimes.
That should work just fine.
The issue here was using an inline comment causes you to hit a bug with code correctness check for exponponets
Andrew Gay
20,893 Pointsthere is a bug in the html and css sections with media querys in css were if you write:
@media screen and(.....
//instead of
@media screen and (...
The challenge wont accept the first.