Menu
I’m the veriest of beginners and I have a question that is probably so basic that I can’t find it on the forum at all…
I have a file (animals.js) that has a variable in it: var myAfricanAnimals = “lion, elephant, gazelle, cheetah”
And I would like to use that data in a second file. I know
<head>
<script src=”animals.js” type=”text/javascript”></script>
</head>
But how do I actually use the data?
Secondly, I would also like to split the data at the comma and put into an array, sorting alphabetically.
I appreciate any help with this.
ChocM