Enum as @param type in JSDoc
问题 Is it possible to use an enum for the JSDoc @param type declaration like in the following example? /** * @enum { Number } */ var TYPES = { TYPE_A: 1, TYPE_B: 2 } /** * @param { TYPES } type */ function useTypesEnum( type ) { } If I use an IDE like Eclipse etc. for JavaScript, there should no warning be raised? 回答1: JsDoc comments have no impact on JavaScript code. What it does influence is some tools designed to use that information. Two of the tools that work with JsDoc comments are the