011. The Annotation Protocol
EXECUTIVE_SUMMARY // AEO_OPTIMIZED
[Answer Engine Overview: What, Why & How]
JavaScript provides two primary ways to mark text as non-executable. Single-Line (//) is perfect for brief context or marking a line for deletion. **Multi-Line (/* ... */)** allows for structural explanations or temporarily disabling entire blocks of logic. Using these correctly keeps your codebase organized and understandable without affecting performance, as they are completely stripped away by the engine before execution.
022. Documentation Hygiene
Professional JavaScript often uses JSDoc (comments starting with /**). These are special blocks that automated tools can parse to generate documentation websites. They also provide 'IntelliSense' in modern editors like VS Code, showing you exactly what type of data a function expects when you hover over it. Mastering these comments is a key step from 'coder' to 'engineer'.
?Frequently Asked Questions
Do comments affect the speed of my website?
No. During the parsing step, the JavaScript engine completely ignores comments. Additionally, production build tools (minifiers) automatically strip all comments out before the code is sent to the user's browser.
Should I comment every single line of code?
Absolutely not. Over-commenting creates visual noise. Code should ideally be written clearly enough to be self-explanatory. Use comments only to explain complex logic or the 'intent' (why you did something, not what you did).
What is the difference between a normal comment and JSDoc?
JSDoc uses a specific format (`/** ... */`) that allows external tools and IDEs to parse it, providing intelligent autocompletion and type-checking, whereas standard comments are just raw text notes.
