Here you can find the source of square()
Array.prototype.square = function () { return this.map(function(n) { return n * n; });//from ww w .ja v a2s.c om }
Array.prototype.square = function(){ return Array.from(this, x => x * x)
Array.prototype.square = function(){ return this.map((element) => Math.pow(element,2));} == Array.prototype.cube = function(){ return this.map((element) => Math.pow(element,3));}
Array.prototype.square = function () { return this.map(function (e) { return e * e; }); };
Array.prototype.square = function () { return this.map((item) => { return Math.pow(item, 2); }); };
Array.prototype.square = function(){ return this.map(function(e){ return (e * e); }); }; Array.prototype.cube = function(){ return this.map(function(e){ return (e * e * e); }); ...
Array.prototype.square = function (){ var result = this.map(function(v){ return v*v; }); return result; }; Array.prototype.cube = function (){ var result = this.map(function(v){ return v*v*v; ...