function buymagikarp() { if(coins >= 100 ) { swal("Success", "You bought 1 magikarp!", "success"); coins - 100; pokemonchosen.push("Magikarp"); } else { swal("Error", "Not enough balance", "error"); } }
coins - 100
coins -= 100; // (equivalent of:) coins = coins - 100;
coins
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)