Battleships object in JS