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 Loops, Arrays and Objects Tracking Multiple Items with Arrays Adding Data to Arrays

Does using double quote in array matter or is it the same as single quote? I am just curious.

I just want to know if single or double quote matter when dealing with array. For example, var Names = ["John", "David", "Joe", "Moses"]; or I should stay with single quote like this var Names = ['John', 'David', 'Joe', 'Moses']; Thanks you and wonderful video.

2 Answers

Samuel Webb
Samuel Webb
25,370 Points

They work the same in this situation. Use whichever one you like the most.

Sometimes you'll want to use one over the other. If you were quoting someone and wanted those quote marks to be a part of the string, it would be simpler to just use single quotes around the whole thing so you don't have to escape characters.

ok, thank you very much.

Samuel Webb
Samuel Webb
25,370 Points

No problem. Glad to help.