Selecting a prize category based on two parameters
To make @kfx's answer more readable:

const getFirstCategory = (bonusPlus, prizeCategories) =&gt; {
  const bonusPlusLevel = bonusPlus ? 2 : 1;
  if (prizeCategories[0].playLevel === bonusPlusLevel) {
    return [prizeCategories[0]];
  }
  return [prizeCategories[1]];
};