How to Create a Multiline Comment in JavaScript Using a Shortcut in VSCode?

Estimated read time 1 min read

In Visual Studio Code, you can create a multiline comment in JavaScript using the following shortcut:

  1. Type /** on a new line in your code.
  2. Press Enter.
  3. Type your comment.
  4. Type */ on a new line.

Your comment should now be surrounded by /* and */, creating a multiline comment in JavaScript. The comment will not be executed by the JavaScript engine, and is only for human readers of the code.

Here’s an example

This is a multiline
comment in JavaScript.

This shortcut works in Visual Studio Code because it is a popular code editor that has support for many popular programming languages, including JavaScript. Different code editors may have different shortcuts for creating multiline comments, so you may want to check the documentation for your code editor to see if a similar shortcut is available.

You May Also Like

More From Author

+ There are no comments

Add yours

Leave a Reply