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 trialMICHAEL P
5,191 PointsSo 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
231,269 PointsStrings 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.
MICHAEL P
5,191 PointsThank you
Christopher Sea
3,726 PointsChristopher Sea
3,726 PointsWhat about single quotes vs backticks? Are there any instances where one would be used over the other, or does the same rule apply here?