how to add comments in visual studio code code example

Example 1: comment highlighted text visual studio

ctrl+k+c Will comment out the selected chunk of code in VS Code.

Example 2: comment out code visual studio

Ctrl+K+C
Ctrl+K+U

Example 3: how to set section of code in comment visual studio

Comment Code Block Ctrl+K+C
undo Comment Code Block Ctrl+K+U

Example 4: commenting in vscode

//To comment a block of code in one go, try Ctrl + K, and the Ctrl + C to
//comment or Ctrl + U to uncomment.

//Pro-Tip: You can also do it without unpressing Ctrl.