I'm making a javascript project and I want to make it as clean as possible, and for that I'm using jsDoc at the top of my methods. For one of them, I would like to know if it's possible to specify as a return type the type of a local variable ?
Like this :
/**
* Add a component to the gameObject
* @param {Function} component to add
* @return {comp.constructor.name}
*/
addComponent(component){
let comp = eval("new Tzu." + component.name + "({gameObject : this});");
this.behaviors.push(comp);
return comp;
}
I want the @return to be the type of comp
Of course the line 4 is completely wrong
Thanks !