🧙‍♂️ Nerd Forum Post of the Day 🧙‍♀️

Help fix this legendary wizard's buggy spell-casting code! Identify the three bugs and type the correct fixes below.


function castSpell(spellName) {
  var mana = 100;
  if (spellName = "fireball") {
    mana = mana - 30
    console.log("Casting fireball!")
  } else if (spellName == "iceblast") {
    mana -= 40;
    console.log("Casting iceblast!");
  } else {
    console.log("Unknown spell...");
  }
  return mana;
}