function getSpells(person) { if(person.type != "Wizard") throw new Error("person.type=" + person.type + " is not Wizard"); }