what do you mean 'function annotations'?
# suitescript
s
what do you mean 'function annotations'?
m
Copy code
/**
* Defines the function definition that is executed before record is loaded.
* @param {Object} scriptContext
 * @param {Record} scriptContext.newRecord - New record
* @param {string} scriptContext.type - Trigger type; use values from the context.UserEventType enum
* @param {Form} scriptContext.form - Current form
 * @param {ServletRequest} scriptContext.request - HTTP request information sent from the browser for a client action only.
* @since 2015.2
*/
const beforeLoad = ....
s
As a matter of quality documentation yes you should include JSDOCs for all functions. If you use TypeScript you can (should) avoid including {types} for the most part.
for what it's worth, if you're using WebStorm there is a shortcut. If you already have a function defined but not jsdocs, if you type the opening comment '/**' then [ENTER] it will fill out a skeleton jsdoc for you.
m
Got it ❤️