Skip to content

Instantly share code, notes, and snippets.

@jamiltron
Created July 13, 2012 20:27
Show Gist options
  • Save jamiltron/3107232 to your computer and use it in GitHub Desktop.
Save jamiltron/3107232 to your computer and use it in GitHub Desktop.
addOne
/** @const */ var ONE = 1;
/**
* A function to add 1 to a number.
* @param {number} n a number to be added.
* @return {number} The number + 1.
*/
var addOne = function (n) {
return n + ONE;
}
/** @type {number} */ var num = null;
console.log(addOne(num));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment