If the line is blank, the shortcut will simply add the
//
so you can add your comment text afterIf the line has code on it already, then the
//
will function to comment out the line of code// This is a single line comment /* This is a multi-line comment */
This shortcut is technically for single line comments but it works perfectly for block comments too.
Just select all of the lines that you want to comment out and press
Cmd
+ /
Repeat the shortcut to reverse the process (aka ”un-comment” the code back in)