- how do i create a jquery constants file and access it from other js files?
- how do i do this?
I have a list of strings. I need to put them into an array A1. Then i need to create another array A2 for some of the elements in A1. The values for A2 would be elements from A1. It's sort of like grouping the strings in A1 to form A2, but i need access to A1 and A2. What's the best way of doing this with javascript/jquery? I figured if I put them into constants, I wouldn't have to repeat them, should the element values change.
e.g.
A1 = "a", "cat", "hat","b", "bob", "ben", "c", "clay", "course", "d", "e", "done"
A2["a"] = "cat", "hat"
A2["b"] = "bob", "ben"
A2["c"] = "clay", "course"
if "cat" becomes "cot", i don't want to have to change it in multiple places... what's the least messy way to do this and make these arrays available to other js files?