const Color = {
RED: 'red',
GREEN: 'green',
BLUE: 'blue',
values: [this.RED, this.GREEN, this.BLUE],
allValues() {
return [this.RED, this.GREEN, this.BLUE]
}
}
console.log(Color.values); // [undefined, undefined, undefined]
console.log(Color.allValues()); // ["red", "green", "blue"]
I recently started learning about javascript and this is tripping me up, I would consider making it work by wrapping it up in a function hacky and would really like to avoid doing that. What am I doing wrong here?