- Object/Oriented JavaScript
- Stoyan Stefanov
- 161字
- 2021-08-13 19:25:53
Comments
One last thing for this chapter: comments. Inside your JavaScript code you can put comments. These are ignored by the JavaScript engine and don't have any effect on how the program works. But they can be invaluable when you revisit your code after a few months, or transfer the code to someone else for maintenance.
Two types of comments are allowed:
- Single line comments—start with
//
and end at the end of the line - Multi-line comments—start with
/*
and end with*/
on the same line or any subsequent line. Note that any code in between the comment start and the comment end will be ignored.
Some examples:
// beginning of line var a = 1; // anywhere on the line /* multi-line comment on a single line */ /* comment that spans several lines */
There are even utilities, such as JSDoc, that can parse your code and extract meaningful documentation based on your comments.
推薦閱讀
- 好的PPT會說話:如何打造完美幻燈片
- 中文版Premiere Pro CC實用教程
- Photoshop CC入門與進階
- Adobe創(chuàng)意大學After Effects產品專家認證標準教材(CS6修訂版)
- Photoshop+Illustrator商業(yè)廣告設計從入門到精通(第2版)
- Liferay Portal Systems Development
- Origin 2022科學繪圖與數據分析(高級應用篇)
- Photoshop CC圖像處理案例教程(第2版)
- 中文版Photoshop 2020基礎培訓教程
- 中文版Illustrator CC完全自學教程
- 中文版3ds Max 2016基礎培訓教程
- 管家婆軟件實戰(zhàn)操作教程(輝煌版)
- Sage ACT! 2012 Cookbook
- Revit 2018中文版建筑設計從入門到精通
- AutoCAD 2018實用教程