I have got 2 javascript variables:
var list1 = "john doe|bill williams|poll bregg|michael jordan";
var list2 = "analytic|trader|doctor|athlete";
We have to take in mind, that relations between this two variables are that names and professions are placed in the same order, eg. poll bregg is a doctor, but john doe is an analytic.
Than I need to create a function, which is going give me 2nd variable value based on 1st variable selected value. For example:
function getProfession(name){
...
return profession;
}
Can you suggest a solution or give a clue?! Perhaps I have to use array of array or smth like this?!