Skip to content

Instantly share code, notes, and snippets.

@luislobo14rap
Created August 24, 2019 10:14
Show Gist options
  • Save luislobo14rap/fbf3fe06040b08900565438549675f9c to your computer and use it in GitHub Desktop.
Save luislobo14rap/fbf3fe06040b08900565438549675f9c to your computer and use it in GitHub Desktop.
array-better-names.js
// array-better-names.js v1
Array.prototype.removeFirst = function(){
let this_ = this;
return this_.shift();
};
Array.prototype.removeLast = function(){
let this_ = this;
return this_.pop();
};
Array.prototype.addInFirst = function(value){
let this_ = this;
return this_.unshift(value);
};
Array.prototype.addInLast = function(value){
let this_ = this;
return this_.push(value);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment