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 trialRupert Travers
4,652 PointsCommenting out multiple lines of JS using //
How does Guil quickly comment out multiple lines of JS using // (some sort of keyboard shortcut I presume) ?
Nik Oaks
8,056 PointsThis is so funny I was blown away when he added 5 comments in 2 seconds.
4 Answers
Noelle Szombathy
10,043 Pointshighlight all the lines then: command + / on mac or ctrl + / on windows
Andrew McKinnon
2,674 Pointsthank you, i was wondering the same thing
Victor Mercier
14,667 PointsHi, you can just select all the lines you want to comment or uncomment and then, do the following:
On Windows: ctrl + / On Mac: cmd + /
If that helped you, please mark as best answer to indicate other students your issue is resolved!
Alexis Perez
1,093 PointsHi! there is 2 ways of comment by keyboard shortcut:
1 - Select the text to want to comment and then press 3 keys: "ctrl" "+" "/" (type it at the same time without the ""). This way you will comment it out with //
2 - Select the text to want to comment and then press 3 keys: "ctrl" "shift" "/" (type it at the same time without the ""). This way you will comment it out with /* */
Doug McGillivray
4,467 PointsI knew this would be here... thank you!
Forrest Pollard
1,988 PointsForrest Pollard
1,988 Pointsdude i was wondering the same thing thanks for posting this so i didnt have to do it myself and wait for an answer haha