Documenting inside javascript
/** * [someFunction description] * @param {[type]} arg1 [description] * @param {[type]} arg2 [description] * @return {[type]} [description] */ var someFunction = function (arg1, arg2) { // Do something... };
Here is what the above code is Doing:
1. We’re creating a variable called someFunction and assigning it a function.
2. The function takes two arguments, arg1 and arg2.
3. The function does something.
Now, let’s look at the same function, but with a few changes: