javascript return statement in a method code example
Example 1: return value from javascript function
function num(x, y) {
var sum = x + y;
return sum;
}
Example 2: return this javascript
Function.prototype.method = function (name, func) {
this.prototype[name] = func;
return this;
};