Skip to content
Snippets Groups Projects
Select Git revision
  • solution
  • main default protected
2 results

items.js

Blame
  • items.js 312 B
    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;
      }
    }