export class Item { constructor(weight, value) { console.assert(weight > 0, `Tried to create an item with a nonpositive weight ${weight}.`); console.assert(Number.isInteger(weight), `Tried to create an item with a noninteger weight ${weight}.`); this.weight = weight; this.value = value; } }