If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
Comments program में line of code होता है जो कि execute नहीं होता है , जिससे कि जब Again हम उस program पर काम करे तो हर step हमें समझ आ सके कि हमने इसमें किया क्या था।
JavaScript में Comments दो तरह के होते हैं -
JavaScript में Single Line Comments // से start करते हैं।
Another File : comments.html
<!DOCTYPE html >
<html>
<head>
<meta charset="utf-8">
<title>Js Syntax</title>
</head>
<body>
<script>
document.write('This is single line comment');
// this is single line comment
</script>
</body>
</html>
multi line comment लिखने के लिए हमें /* से start करते हैं और */ से end करते है।
See Example :
Another File : comments2.html
<!DOCTYPE html >
<html>
<head>
<meta charset="utf-8">
<title>Js Syntax</title>
</head>
<body>
<script>
document.write('This is multi line comment');
/* this is
multi
line
comment
*/
</script>
</body>
</html>
किसी भी project पर काम करने के बाद हमें जरूरत के हिसाब से समय के साथ उसमे changes करने पढ़ ही जाते हैं तो जब हम update करें तो हमें proper पता चले कि हमने किया क्या था।
या जब कोई दूसरा programmer हमारे द्वारा develop किये गए project को देखे या update करे तो उसे भी पता चले।
Comment लिखना आपकी Coding Standardization को भी बताता है।
कमेंट लिखने से Coding Readability भी बढ़ती है।
Hi ! My name is Rahul Kumar Rajput. I'm a back end web developer and founder of learnhindituts.com. I live in Uttar Pradesh (UP), India and I love to talk about programming as well as writing technical tutorials and tips that can help to others.
Get connected with me. :) LinkedIn Twitter Instagram Facebook