FANDOM


A page in the
 
Introduction
 
Basics
Statements · Control Flow Statements · Comments · Objects · Functions · Style
Features
Scoping · Inheritance · DOM


It has been suggested that this page or section be merged into Wikibooks:JavaScript. (Discuss)

Comments contain text intended for human readers and ignored by the parser. The text may be in any language (or none at all). Comments are typically used to either explain obscure code or remove some JavaScript from the program.

JavaScript provides two means of commenting text.

//This is a "line comment" and is the more common type.  It begins with two slashes
//and ends with a newline.  To write such a long message, more than one line comment
//is needed to make it easier for humans to read and to prevent complications caused
//by programs (like email programs) which split long lines up and, in so doing,
//invalidate the JavaScript if it contains long line comments.
/*This is a "multi-line comment" and is the more predictable type.  It begins with a slash and an asterisk (star) and ends with
the same characters in the reverse order.  JavaScript doesn't care what a multi-line comment contains given that it is
terminated properly.*/

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.