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 Review Introducing JavaScript

Norbu Wangdi
Norbu Wangdi
7,187 Points

Which of the following is an example of JavaScript "syntax"?

console.log('Program started'); console.log("Program started"); both same thing?

As long as you are consistent with either single-quotes, or double-quotes for the example the syntax is correct.

2 Answers

Marissa Richardson
Marissa Richardson
47,542 Points

Yes. You can interchange single and double quotes as long as you are consistent. As in, if you begin with a single quote, you must close your string with a single quote.