
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do we use single line comments in JavaScript?
The following is a single line comment in JavaScript. Any text between a // and the end of a line is treated as a comment and is ignored by JavaScript.
// This is a comment. It is similar to comments in C++
The following example showing how to use single line comments in JavaScript.
<script> <!-- // This is a comment. It is similar to comments in C++ //--> </script>
- Related Questions & Answers
- How do we use multi-line comments in JavaScript?
- Java single line comments.
- How to write single-line comments in C#?
- What is the difference between single-line and multi-line comments in JavaScript?
- How do we provide comments in Python?
- How do we use a #line directive in C#?
- How do we add a single-line input field in HTML?
- How do we create multiline comments in Python?
- How do we use throw statement in JavaScript?
- Java multi-line comments
- How to use comments to prevent JavaScript Execution?
- Why do we use jQuery over JavaScript?
- Why do we use "use strict" in JavaScript?
- In JavaScript Why do we use "use strict"?
- Do we need to use semicolons in JavaScript?
Advertisements