google closure reference演示如何注释记录:
{{myNum: number, myObject}}
An anonymous type with both a property named myNum that has a value of type number and a property named myObject that has a value of any type.
我有任意字符串到数字的哈希值。目前尚不清楚我如何指示这一点,因为在示例中左侧两次都是特定的属性名称。我应该如何注释我的哈希?
最佳答案
/** @type {Object.<number>} */
或
/** @type {Object.<string, number>} */
关于javascript - 如何在谷歌闭包中注释哈希?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8548226/