


Summary of comments usage and precautions in javascript_javascript skills
May 16, 2016 pm 06:01 PMThere are two ways to comment in JavaScript:
Single-line comments: //
Multi-line comments: /* */
Comments are mainly to make the program we write more convenient It is readable and convenient for others to make secondary modifications
Look at the example below, we annotated the regular expression with /* */, and a syntax error was reported during runtime
/*
var rm_a = /a*/.match (s);
*/
So block-level comments are unsafe. If we make such a mistake in our code, it will be difficult to troubleshoot
So it is best to use single-select comments // instead of multi-line comments /* */
JavaScript comments

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Conveniently use PyCharm shortcut keys to implement multi-line comments

How to Optimize the Maintainability of Java Code: Experience and Advice

How to comment multiple lines in go language

How to add notes to saved passwords on iPhone

PyCharm Annotation Operation Guide: Optimizing the Code Writing Experience

A detailed explanation of annotations in golang

The php language supports several comment styles

Share tips for quickly commenting code in PyCharm to improve work efficiency
