Letti42Lvl 6
- Windows
The line (itemsP1[0] === "goggles" ? "Equip": itemsP1[0] === "gogglesEquipped" ? "Unequip": "")
in Varrience's code basically means:
if(itemsP1[0] === "goggles"){
return "Equip";
}else {
if(itemsP1[0] === "gogglesEquipped"){
return "Unequip";
} else return "";
}
Just an easy way not to scar your eyes with an excessive amount of if else statements