Skip to content

Instantly share code, notes, and snippets.

@Takazudo
Created June 10, 2011 08:34
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 Takazudo/1018468 to your computer and use it in GitHub Desktop.
Save Takazudo/1018468 to your computer and use it in GitHub Desktop.
js commentation example
/* js comment format collection */
/*!
* script name
*
* @author : Takeshi Takatsudo (takazudo[at]gmail.com)
* @copyright : Takeshi Takatsudo
* @license : The MIT License
* @link : http://.....
* @modified : 2011/04/26 HH:MM:SS
*
* some comments here
*/
/**
* @tag value
*/
/**
* Reverse a string
*
* @param {String} input String to reverse
* @return {String} The reversed string
*/
var reverse = function(input){
// do something
return output;
};
/**
* Constructs Person objects
* @class Person
* @constructor
* @namespace MYAPP
* @param {String} first First name
* @param {String} last Last name
*/
MYAPP.Person = function(first, last){
...
};
/**
* Name of the person
* @property first_name
* @type String
*/
this.first_name = first;
/**
* Last (family) name of the person
* @property last_name
* @type String
*/
this.last_name = last;
/**
* Returns the name of the person object
*
* @method getName
* @return {String} The name of the person
*/
MYAPP.Person.prototype.getName = function(){
return this.first_name + ' ' + this.last_name;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment