@符号是否表示javascript中的任何内容? [英] Does the @ symbol mean anything in javascript?

查看:62
本文介绍了@符号是否表示javascript中的任何内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到许多javascript文件中提到的@符号,并且无法弄清楚这个角色的重要性。例如:

I noticed the @ symbols mentioned in many javascript files and couldn't figure out the significance of this character there. for example:

/**
    * Calls the specified callback function for all the elements in an array. The return value of
    * the callback function is the accumulated result, and is provided as an argument in the next
    * call to the callback function.
    * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
    * callbackfn function one time for each element in the array.
    * @param initialValue If initialValue is specified, it is used as the initial value to start
    * the accumulation. The first call to the callbackfn function provides this value as an argument
    * instead of an array value.
*/

那么,@ param在这里意味着什么?

P.S. - 以上是对callbackfn和initialValue作为参数的函数的描述。

So, does the @param mean anything here?
P.S. - The above is a description of a function with callbackfn and initialValue as parameters.

推荐答案

该评论是 JSDoc @param callbackfn 表示以下是参数 callbackfn 的描述。

That comment is JSDoc. The @param callbackfn means "what follows is the description of the argument callbackfn".

您的IDE可能能够解析该格式,或者您可以使用jsdoc 从中生成文档。

Your IDE might be able to parse that format or you can use jsdoc to generate documentation from that.

这篇关于@符号是否表示javascript中的任何内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆