我在脚本中找到了这一段
var name = project.SMALL_WIDTH//p.containerWidth() /// 2//project.WIDTH / 4
双斜杠和三斜杠是什么意思?
最佳答案
///
(很可能)只是用来分割部分评论。但是,它们对代码没有任何影响。浏览器不会呈现 JavaScript 代码中 //
之后的所有内容。你可以这样做,它仍然有效:
<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>
此外,您还可以进行多行注释:
<script type="text/javascript">
/*
This is a
multiple
line
comment!
*/
</script>
如您所见,JavaScript 中的多行注释与 CSS 注释非常相似。
关于javascript - JavaScript 中的双斜线是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8143477/