checkUnlockBuyableUpgrades() {
    // temp variables to improve code readability
    const [coffee, multiMonitor, headphones] = [
      this.upgrades.coffee,
      this.upgrades.multiMonitor,
      this.upgrades.headphones
    ];

    if (this.score >= coffee.price && !coffee.unlocked) {
      UI.unlockBuyableItem('Coffee');
      coffee.unlocked = true;
    } else if (this.score >= multiMonitor.price && !multiMonitor.unlocked) {
      UI.unlockBuyableItem('multiMonitor');
      multiMonitor.unlocked = true;
    } else if (this.score >= headphones.price && !headphones.unlocked) {
      UI.unlockBuyableItem('headphones');
      headphones.unlocked = true;
    }
  }
// checks and unlocks upgrades if player has enough commits
checks and unlocks upgrades if player has enough commits
checks and unlocks upgrades if player has enough commits
checkUnlockBuyableUpgrades() {
    const [coffee, multiMonitor, headphones] = [
      this.upgrades.coffee,
      this.upgrades.multiMonitor,
      this.upgrades.headphones
    ];
    if (this.score >= coffee.price && !coffee.unlocked) {
      UI.unlockBuyableItem('Coffee');
      coffee.unlocked = true;
    } else if (this.score >= multiMonitor.price && !multiMonitor.unlocked) {
      UI.unlockBuyableItem('multiMonitor');
      multiMonitor.unlocked = true;
    } else if (this.score >= headphones.price && !headphones.unlocked) {
      UI.unlockBuyableItem('headphones');
      headphones.unlocked = true;
    }
  }
checkUnlockBuyableUpgrades ( ) { const [ coffee , multiMonitor , headphones ] = [ this . upgrades . coffee , this . upgrades . multiMonitor , this . upgrades . headphones ] ; if ( this . score >= coffee . price && ! coffee . unlocked ) { UI . unlockBuyableItem ( 'Coffee' ) ; coffee . unlocked = true ; } else if ( this . score >= multiMonitor . price && ! multiMonitor . unlocked ) { UI . unlockBuyableItem ( 'multiMonitor' ) ; multiMonitor . unlocked = true ; } else if ( this . score >= headphones . price && ! headphones . unlocked ) { UI . unlockBuyableItem ( 'headphones' ) ; headphones . unlocked = true ; } }
checks and unlocks upgrades if player has enough commits
checks and unlocks upgrades if player has enough commits
// temp variables to improve code readability