VScode sets the user's own code snippet
In order to improve the speed and efficiency of writing code, we often use code snippets to "be lazy" when using vscode.
here is the image
There is a "User code snippet" option setting in the gear setting in the lower left corner of vscode, and there will be a search box after clicking
Among the many options, there is a file javascript.json
called , which comes with vscode, click to open the json file
The contents inside will be displayed, and vscode will provide you with a chestnut, which is our commonly console.log()
used code snippet. After I open the comment:
Everything in it is a json file, so a code snippet will be separated by a comma, so we have to follow its rules.
The first line: Print to console
means what to print out.
The second line: prefix: log
means keywords ( that is, you only need to type the log in the js file to display the code hints )
. The third line: body
means the complete code displayed according to the keyword hints. (Include the newline symbol "\n", that is, an extra line will be automatically changed)