A solution to this code challenge: https://www.interviewcake.com/question/javascript/cake-thief
| 1 | class Bag { |
| 2 | constructor (capacity) { |
| 3 | this.capacity = capacity; |
| 4 | this.cakes = []; |
| 5 | this.weight = 0; |
| 6 | this.value = 0; |
| 7 | } |
| 8 | |
| 9 | addCake (cake) { |
| 10 | this.cakes.push(cake); |