GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — JavaScript Comments - GeeksforGeeks JavaScript CommentsLast Updated : 11 Jul, 2025 Comments help explain code (they are not executed and hence do not have any logic implementation). We can also use them to temporarily disable parts of your code. 1. Single Line CommentsA single-line comment in JavaScript is denoted by two forward slashes (
Output Hello Geeks! 2. Multi-line CommentsA multiline comment begins with /* and ends with */
Output Multiline comment in javascript JavaScript Comments in HTMLPrerequisite : How to Add JavaScript in HTML Document? The syntax of comments remains same when we write inside HTML script tag.
JavaScript Comments to Prevent ExecutionWe can use // or /*...*/ to change the JavaScript code execution using comments. JavaScript Comments are used to prevent code execution and are considered suitable for testing the code.
Output 30 Example 2: This example uses multi-line comments to prevent the execution of addition code and perform subtraction operations.
Output -10 Comment Explore |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |