We write all about Webmaster needs.

JavaScript Statement, Block and Comments

ADVERTISEMENT



JavaScript can be stated as a statement or block, Statement which does not contains open braces and close braces .

Example for statement

<script type="text/javascript">
document.write("Statement");
</script>

Example for block

<script type="text/javascript">
{
 document.write("Block");
}
</script>

Comments : Comments are used as developer identification when ever any developer monitors he or she should understand. comments contains single line comment and multiple line comments as like as other languages.

Example for Single line comment

<html>
<body>
<script type="text/javascript">
//document.write("testing single line comment");
document.write("test success");
</script>
</body>
</html>

Example for multiple line comments

<html>
<body>
<script type="text/javascript">
/*
document.write("Testing Multiple line comments");
*/
document.write("Testing Succeeded");
</script>
</body>
</html>

Pages

RSS Syndication