Does anybody know how to comment a syntax of code in repl.it editor ??
What do you mean with “comment”?
// in front of it
All languages have their own way to add comments
in which language? it’s not specific to the editor, it’s specific to the language. Probably
you need to add // in front of the code, not select and then type
or if you have a block of code you want to comment (as in more than one line) write
*/ after the block of code
and if you right click and choose “Command Palette” it will show you all the shortcuts you can use
@ieahleen I am not getting ur first point. suppose I want to comment a block of code then I’ll need to just go on the first line of code and need to add //. Isn’t like that ??
If you use
// then the rest of the line is commented out
If you want different lines commented out you need to add
/* at the beginning and
*/ at the end
// this is a signle-line comment /* this is a multi-line comment */
He is saying to comment a block of code, format looks like this:
Or for single line:
// line of code
Yes I get and I go with second option every time. But I’ve seen in many video tutorials lecturer just select the code and press //. The entire code will be commented. Sorting out how to do that. Will share video then might u can see and sort it out.
They certainly don’t use just
// as a shortcut
Check the command palette (right click -> command palette)
I remember something like below but I may be completely wrong as I don’t have it in front on me
The short cut for single line comment is
Really? It should be Ctrl+/
It is in the Command Palette of the editor… I didn’t choose it myself
Ctrl+K Ctrl+C adds // to the beginning, Ctrl+/ toggles comment. Ctrl+/ is the more common one too
And easier to press.
Thank you guyz for helping me out.
We can use both either ctrl+/ or ctrl+k ctrl+c
But if you want to toggle, use Ctrl+/