Getting info for drop-down menu from js (javascript) file

Does anyone know how would I do this?

I have a separate JavaScript file that has an array that contain car names.

When I click a link (Browse Cars), it will load a new page and go into the JavaScript file and grab all the car names from the array and display them. Is this possible to do? How would I go about performing this? Thanks.