Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics (Retired) Introducing JavaScript Your First JavaScript Program

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
216,878 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?