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

JavaScript JavaScript Basics (Retired) Storing and Tracking Information with Variables Review JavaScript Variables

David Brophy
David Brophy
4,238 Points

JavaScript Variable

It says:


Complete the code below to store the value 100 in the variable named score

var score =


I tried writing "100" but it says that's wrong. It doesn't tell me what the right answer is so can someone let me know?

2 Answers

When you have the number in quotes it becomes a string, think of that as a text value. The value of '100' is not the same as 100, which is an integer.

http://www.quirksmode.org/js/strings.html

Are you putting 100 between quotes? Try it without them.

David Brophy
David Brophy
4,238 Points

Thanks, that worked. But why don't I need the quotes? All the examples so far seem to use them.