什么时候否定 JSDoc 中的 return 值?
When does one negate the return value in JSDoc?
我在 Protractor 文档中看到了很多,
/**
* ...
* ...
*
* @returns {!webdriver.promise.Promise} A promise which resolves to the
* number of elements matching the locator.
*/
return 对象的 否定 是怎么回事?什么时候使用?
我承认也许它不是严格意义上的 "negation," 但符号应该记录在某处。
谢谢!
根据JSDoc spec:
Non-nullable type
{!number}
A number, but never null
Indicates that the value is of the specified type, but
cannot be null
.
我在 Protractor 文档中看到了很多,
/**
* ...
* ...
*
* @returns {!webdriver.promise.Promise} A promise which resolves to the
* number of elements matching the locator.
*/
return 对象的 否定 是怎么回事?什么时候使用?
我承认也许它不是严格意义上的 "negation," 但符号应该记录在某处。
谢谢!
根据JSDoc spec:
Non-nullable type
{!number}
A number, but never nullIndicates that the value is of the specified type, but cannot be
null
.