- Open the vscode
- Add custom code snippets:
- Press CTRL + Shift + P, type configure User Snippet, select the first one
- Choose javascript
- Add the following code
{ "mylog": { "prefix": "mylog"."body": [ "console.log({$1})".""]."description": "mylog" } Copy the code
- Open a JS file, type mylog and press TAB.
- If you want to change the trigger directive, change the value of the prefix field above.