Important Notice:

JavaScript Comments

JavaScript Comments

19 views 1 min read

JavaScript कमेंट (Comments) :-

कमेंट्स का उपयोग कोड को समझाने या उसे अस्थायी रूप से अक्षम (disable) करने के लिए किया जाता है। ब्राउज़र कमेंट्स को execute (चलाना) नहीं करता। यह executable नहीं होता है।

दो प्रकार के कमेंट होते हैं:

1- एक-लाइन कमेंट (Single-line comment):
// से शुरू होता है।
उदाहरण:

js

// यह एक कमेंट है let x = 5; // यह भी कमेंट है (कोड के बाद)

2- मल्टी-लाइन कमेंट (Multi-line comment):
/* से शुरू और */ पर खत्म होता है।
उदाहरण:

js

/* यह एक मल्टी-लाइन कमेंट है जितनी लाइनें चाहें लिख सकते हैं */ let y = 10;


JavaScript Comments

Comments are used to explain code or to temporarily disable it. The browser does not execute comments. Comments are not executable.

There are two types of comments:

1-Single-line comment:
Starts with //
Example:

js

// This is a comment let x = 5; // This is also a comment (after code)

2-Multi-line comment:
Starts with /* and ends with */
Example:

js

/* This is a multi-line comment You can write as many lines as you want */ let y = 10;

JavaScript Identifier :-

Related Notes