Using JSDoc annotations
In the preceding test function, you can see that the code hint became active as soon as you type a '.
' next to the identifier name (Chapter8
). This shows all the functions and global variables available in the external library as shown here:
The preceding code hints are generic, for example, index
shown as Object
. For detailed code hints, you should use the JSDoc style documentations (annotations or comments at top lines of function definitions).
For example, if you used the following annotations to the getPrice
function in Chapter 8, Building a Workflow Application:
/** * Returns price list data from the Stock tab/sheet * * @param {number} index * @return {array} * */ function getPrice(index){ … }
Then the code hint would be as shown here:
Now, you can notice how the code hint returns with useful information for the getPrice
function.
Tip
For further reading on JSDoc, visit: https://developers.google.com/closure/compiler/docs/js-for-compiler.