The double forward slash //
is a comment in JavaScript, but what does a triple forward slash ///
mean? The reason I am asking is the code breaks when I remove a line that has ///
. Which leads me to believe that ///
is not a comment.
Could be a reference directive
Does it look like this?
/// <reference path="jquery-1.8.2.js" />
These are all comments:
//
// ..............
//..............
// //////////////
////////////////
///
/// ..............
since the comment extends from the //
to the end of the line.
Edited to add: Of course, there are various contexts where neither //
nor ///
introduces a comment. For example:
'///' <-- this is a string
"///" <-- this is a string (same as previous)
/[///]/ <-- this is a regular expression (same as /\//)
/* /// */ <-- this is a comment delimited by /*...*/
/\///3 <-- this is /\// divided by 3, i.e., not-a-number
A commented out slash character in the code.
If it is in a regular expression, please provide the context/complete line of code to allow quality explanations to be provided.
In Javascript anything that begins with at least 2 //, is a comment, adding one more would make no difference as far as the code not working.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With