Created
March 17, 2018 04:21
-
-
Save jordanhudgens/9d0206a148e21f2e7fc0db14301b44b4 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 DecoratedClass { | |
constructor(arr) { | |
this.arr = arr; | |
this.total = 0; | |
} | |
sum() { | |
this.arr.map(el => { this.total += el }) | |
return this.total; | |
} | |
} | |
const arr = [1, 2, 3]; | |
dc = new DecoratedClass(arr); | |
dc.arr; | |
dc.sum(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment