I have a module with a single method (or multiple, it doesn't matter for now):
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory(root));
} else {
root.fn = factory(root);
}
})(typeof global !== "undefined" ? global : this.window || this.global, function (root) {
'use strict';
const my_method = (bar) => {
console.log('bar', bar);
}
return {
myMethod: my_method
}
});
And I call it like follows:
fn.myMethod('foo');
My question is: Is there a way to document this method? (to know how it works when I call it from another code block - in an IDE tooltip, for example)
E.g.:
/**
* How this method works
* @param {any} bar
*/
const my_method = (bar) => {
...
}