Skip to content

Instantly share code, notes, and snippets.

@sushiljainam
Created December 27, 2016 09:48
Show Gist options
  • Save sushiljainam/1064f7b8703de80b7b8f9147b4a7ee1b to your computer and use it in GitHub Desktop.
Save sushiljainam/1064f7b8703de80b7b8f9147b4a7ee1b to your computer and use it in GitHub Desktop.
enhancing array capabilities
Array.prototype.pushUnique = function(elem) {
if(this.indexOf(elem) == -1){
this.push(elem);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment