Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
36
rated 0 times [  38] [ 2]  / answers: 1 / hits: 15266  / 13 Years ago, tue, november 15, 2011, 12:00:00

I've found this piece in a script



var name = project.SMALL_WIDTH//p.containerWidth() /// 2//project.WIDTH / 4


What do the double and the triple slash mean?


More From » jquery

 Answers
18

The /// is (most likely) there only to divide up parts of the comment. But, they don't have any affect in the code. Everything after a // in a JavaScript code is not rendered by the browser. You could do this and it would still work:



<script type=text/javascript>
// Hello! I'm a comment! ///////////////// these slashes don't do anything as they're in a comment.
// The double slashes tell the browser not to render it.
</script>


Also, you can do multiple line comments:



<script type=text/javascript>
/*
This is a
multiple
line
comment!
*/
</script>


As you can see, multiple line comments in JavaScript are very similar to CSS comments.


[#89101] Monday, November 14, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
frederickmohamedw

Total Points: 21
Total Questions: 123
Total Answers: 105

Location: The Bahamas
Member since Tue, Apr 27, 2021
3 Years ago
;