What does /// mean in JavaScript?

The double slash // is a comment in JavaScript, but what does the triple slash /// mean? The reason I'm asking is because of code breaking when deleting a line from /// . This makes me think that /// not a comment.

+6
source share
5 answers

May be a directive

It looks like this?

 /// <reference path="jquery-1.8.2.js" /> 
+9
source

All these comments:

 // // .............. //.............. // ////////////// //////////////// /// /// .............. 

as the comment continues from // to the end of the line.

Edited to add: Of course, there are various contexts in which no comment // or /// is entered. For instance:

 '///' <-- 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, ie, not-a-number 
+7
source

Commented out slash character in code.

If it is in regular expression, provide a contextual / full line of code to ensure that you provide quality explanations.

+1
source

In Javascript, everything that starts with at least 2 // is a comment, adding another one doesn't matter if the code doesn't work.

+1
source

anything after "//" is still a comment on the same line. You may ask, what does "// (infinity)" mean? The same answer. Comments

There may be specialized programs that interpret JS on the fly and do special things with ///, but that is beyond the scope of this question.

+1
source

Source: https://habr.com/ru/post/910017/


All Articles