Last active
January 8, 2017 00:50
-
-
Save kylejlin/4c66b9a935ab10d4908d8f8c097ea344 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Listy extends Array { | |
constructor() { | |
super(arguments); | |
} | |
customContains(item) { | |
return this.indexOf(item) > -1; | |
} | |
} | |
const list = new Listy('hello', 'world'); | |
console.log(list, list.customContains('hello'), list.customContains('world')); | |
alert(list); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment