Update JavaScript

Fixed the bug with the resources not being subtracted properly and the game now correctly identifies when enough resources are present to buy a building.