comment | JavaScriptSource


JavaScriptSource Staff Jul 24, 2006
Previous     Contents     Index     Next     
Core JavaScript Reference 1.5

Chapter 4   Chapter 4 Comments

This chapter describes the syntax for comments, which can appear anywhere between tokens.


Notations by the author to explain what a script does. Comments are ignored by the interpreter.

Implemented in  

JavaScript 1.0, NES 2.0  

ECMA version  


// comment text
/* multiple line comment text */

JavaScript supports Java-style comments:

  • Comments on a single line are preceded by a double-slash (//).

  • Comments that span multiple lines are preceded by a /* and followed by a */.

// This is a single-line comment.
/* This is a multiple-line comment. It can be of any length, and
you can put whatever you want here. */

Previous     Contents     Index     Next     
Content is available under these licenses.
Last Updated September 28, 2000

Leave a Response

(1 comment)

HTML5 is the new standard that is expected to take over the Web. New versions of browsers are already starting to support the advanced features. Learn why HTML5 is important and discover how to start developing with it today.

Neo May 26, 2015