/**
* @param {(string|string[])} name - User's name, or an array of names
*/
/**
* @param {*} name - User's name
*/
___
/**
* Assign the project to an employee.
*
* @param {Object} employee - The employee who is responsible for the project.
* @param {string} employee.name - The name of the employee.
* @param {string} employee.department - The employee's department.
*/
Project.prototype.assign = function(employee) {
// ...
};
___
/**
* Greet the user
*
* @param {string} [name] - Name of person to say hello to
* @returns {string} Greeting
*/
function hello(name) {
name = name || "visitor";
alert("Hello " + name + "!");
}
___
/**
* Return the sum of all numbers passed to the function
*
* @param {...number} num - A positive or negative number.
*/
function sum(num) {
var i = 0, n = arguments.length, t = 0;
for (; i < n; i++) {
t += arguments[i];
}
return t;
}
___
/**
* Greet the user
*
* @param {string} name - Name of person to say hello to
* @returns {string} Greeting
*/
function hello(name) {
return "Hello "+name +"!";
}
___
/**
* Create a new book
*
* @constructor
* @param {string} title - The title of the book.
* @param {string} author - The author of the book.
*/
function Book(title, author) {
// ...
}
var book = new Book("The Da Vinci Code", "Dan Brown");