Q:

what is the javascript code for comments

<script type="text/javascript">
<!--
document.write("I have multi-line comments!");
/*document.write("You can't see this!");
document.write("You can't see this!");
document.write("You can't see this!");
document.write("You can't see this!");
document.write("You can't see this!");
document.write("You can't see this!");
document.write("You can't see this!");*/
//-->
</script>

8
//This does not effect the code.
var something = "But this does effect the code!";
3
<script type="text/javascript">
<!--
// This is a single line JavaScript comment

document.write("I have comments in my JavaScript code!");
//document.write("You can't see this!");
//-->
</script>

6

/*
this will not be seen by javascript and does not effect your program.
and this is a multi line comment.
for single line comment use // before and after any sentence
*/

var schoolname = 'anyschool';
console.log(schoolname)

  
1

New to Communities?

Join the community