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) Introducing JavaScript Your First JavaScript Program

MICHAEL P
MICHAEL P
5,191 Points

So is the portion that is within the ("); a string in javascript, like in Ruby?

Hi, I had just finished the Ruby track here on Treehouse. My question is: is the portion that is within the ("); a string in javascript, like in Ruby?

2 Answers

Steven Parker
Steven Parker
231,007 Points

:point_right: Strings in JavaScript can be enclosed in quotes (") or apostrophes (').

It doesn't matter as long as you are consistent for a particular string (don't open with one and close with the other!).

Note that quotes (") will often be called double quotes and apostrophes (') can be called single quotes.

What about single quotes vs backticks? Are there any instances where one would be used over the other, or does the same rule apply here?