JS code fixes

Initilized the countries to an array and removed the for loop.