我有返回對象的函數。我希望把他們的jsdoc定義在webstorm intellisense上看到他們的屬性和方法。JSDOC和揭示模塊模式
我該如何編寫jsdoc的以下函數?
function MyOtherFunc() {
return { a:'for eg string', b:12 }
}
function MyFunc() {
var prop = MyOtherFunc();
function myMethod() {
alert('my method');
}
function myOtherMethod() {
alert('my other method');
}
// explicitly return public methods when this object is instantiated
return {
someMethod : myMethod,
someOtherMethod : myOtherMethod
};
}
我已經完成了這個過去,但最近很難記住我之前做過的。試圖弄明白的時候遇到了你的問題。 :-) –