coffeescript - 如何评论? “/ * this * /”不工作 [英] coffeescript - How to comment? "/* this */" doesn't work
问题描述
您在哪些方面可以在Coffeescript中评论?文档说您可以使用3个哈希符号来启动和关闭注释块。
###
comments
go
here
###
有时可以使用以下两种格式
`//反引号允许直接JavaScript,
// backtick不能在注释行(我想?)
`
$ b b
由于这会得到很多意见,我想强调这里
/ *当 / *
时,
正如Trevor在对该问题的评论中指出的,这是一个正则表达式,不的注释!
使用单个#符号
#like this
一个字符看起来很少;)
另外:
###
此区块评论(适用于©-Copyright info) gets
传递给浏览器HTML / *这样! * /
###
In what ways can you comment in Coffeescript? The docs say you can use 3 hash symbols to start and close a comment block
###
comments
go
here
###
I've found that I can sometimes use the following two formats
`// backticks allow for straight-javascript,
//but the closing backtick can't be on a comment line (I think?)
`
Are there any simpler ways to insert short comments in coffeescript?
Edit: do NOT use this style
Since this is getting a lot of views, I want to emphasize that this
/* comment goes here */
produces a MATH error when the /*
is on its own line.
As Trevor pointed out in a comment on the question, this is a regex, NOT a comment !
Use a single # sign
# like this
One character seems pretty minimal ;)
Also:
###
This block comment (useful for ©-Copyright info) also gets
passed on to the browsers HTML /* like this! */
###
这篇关于coffeescript - 如何评论? “/ * this * /”不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!