Skip to content

Instantly share code, notes, and snippets.

@shuhrat
Last active December 28, 2015 22:14
Show Gist options
  • Save shuhrat/4174462 to your computer and use it in GitHub Desktop.
Save shuhrat/4174462 to your computer and use it in GitHub Desktop.
Array challange
Array.prototype.tail = function() {
return Array.prototype.concat.apply(this, this);
}
Array.prototype.dublicate = function() {
var dublicated = [],
length = this.length;
for (var i=0; i<length; i++) {
dublicated.push(this[i], this[i]);
}
return dublicated;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment