- 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.
推薦閱讀
- HTML5 Multimedia Development Cookbook
- Vue.js框架與Web前端開發從入門到精通
- Learning Ext JS 3.2
- Getting Started With Oracle SOA Suite 11g R1 – A Hands/On Tutorial
- Web 2.0 Solutions with Oracle WebCenter 11g
- 攝影輕松入門:Photoshop后期處理
- Photoshop CC UI設計標準培訓教程
- AutoCAD 2017從新手到高手
- 用Cubase輕松制作你的短視頻音樂
- Maya 2020 超級學習手冊
- Instant Flask Web Development
- 巧用ChatGPT高效搞定Excel數據分析
- Photoshop CS6平面設計實戰從入門到精通(經典暢銷版)
- 邊做邊學:CorelDRAW X6圖形設計案例教程(第2版)(微課版)
- 寫給大家看的PPT設計書(第2版)