Commenting code
It is best practice to always document your JavaScript code through the use of comments. At a minimum, this should include the author of the code, date of last revision, and the general purpose of the code. In addition, at various points throughout your code you should include comment sections that define the purpose of specific sections of the application. The purpose of this documentation is to make it easier for you or another programmer to quickly get up to speed in the event that the code needs to be updated in some way.
Any comments that you include in your code are not executed. They are simply ignored by the JavaScript interpreter. JavaScript can be commented in a couple of ways including single line and multi-line comments. Single line comments start with // and any additional characters you add to the line. The following code example shows how single line comments are created:
//this is a single line comment. This line will not be executed
Multi-line comments in JavaScript start with /* and end with */. Any lines in between are treated as comments and are not executed. The following code example shows an example of multi-line comments (also called block comments):
/* Copyright 2012 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */
- 手機(jī)安全和可信應(yīng)用開(kāi)發(fā)指南:TrustZone與OP-TEE技術(shù)詳解
- C語(yǔ)言程序設(shè)計(jì)實(shí)踐教程(第2版)
- DevOps with Kubernetes
- Photoshop智能手機(jī)APP UI設(shè)計(jì)之道
- Python語(yǔ)言程序設(shè)計(jì)
- C和C++安全編碼(原書(shū)第2版)
- Mastering Entity Framework
- 樂(lè)學(xué)Web編程:網(wǎng)站制作不神秘
- Unity 3D/2D移動(dòng)開(kāi)發(fā)實(shí)戰(zhàn)教程
- SQL Server 2016 從入門到實(shí)戰(zhàn)(視頻教學(xué)版)
- Practical Microservices
- JQuery風(fēng)暴:完美用戶體驗(yàn)
- 深入淺出Python數(shù)據(jù)分析
- Puppet:Mastering Infrastructure Automation
- Three.js權(quán)威指南:在網(wǎng)頁(yè)上創(chuàng)建3D圖形和動(dòng)畫(huà)的方法與實(shí)踐(原書(shū)第4版)