Skip to content

Instantly share code, notes, and snippets.

@duaneleem
Created January 20, 2018 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duaneleem/a8f49a0167fa65d707dd1ee047672c4a to your computer and use it in GitHub Desktop.
Save duaneleem/a8f49a0167fa65d707dd1ee047672c4a to your computer and use it in GitHub Desktop.
Documentation example.
/** Class representing a point. */
class Point {
/**
* Create a point.
* @param {number} x - The x value.
* @param {number} y - The y value.
*/
constructor(x, y) {
// ...
}
/**
* Get the x value.
* @return {number} The x value.
*/
getX() {
// ...
}
/**
* Get the y value.
* @return {number} The y value.
*/
getY() {
// ...
}
/**
* Convert a string containing two comma-separated numbers into a point.
* @param {string} str - The string containing two comma-separated numbers.
* @return {Point} A Point object.
*/
static fromString(str) {
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment