4.1 Single-line comments
为了提高代码的可读性,JS与CSS一样,也提供了注释功能。
JS中的注释主要有两种,分别是 单行注释 和 多行注释。
Note single-line comments as follows:
// 我是一行文字,不想被 JS引擎 执行,所以 注释起来
// 用来注释单行文字( 快捷键 ctrl + / )
More than 4.2-line comments
Multi-line comments comments as follows:
/*
获取用户年龄和姓名
并通过提示框显示出来
*/
/* */ 用来注释多行文字( 默认快捷键 alt + shift + a )
Shortcuts amended as: ctrl + shift + /
vscode → Preferences → Keyboard Shortcuts button → Find → modify the original shortcut keys for the new shortcut key → Confirm