You have two arrays. One shows the names of the people names, while the other shows their occupation jobs. Your task is to create an object displaying each person to their respective occupation.
| Names | Jobs |
|---|---|
| Annie | Teacher |
| Steven | Engineer |
| Lisa | Doctor |
| Osman | Cashier |
const names = ["Dennis", "Vera", "Mabel", "Annette", "Sussan"]
const jobs = ["Butcher", "Programmer", "Doctor", "Teacher", "Lecturer"]
assignPersonToJob(names, jobs) ➞ {
Dennis: "Butcher",
Vera: "Programmer",
Mabel: "Doctor",
Annette: "Teacher",
Sussan: "Lecturer"
}
names array is the same as the index of the person's job in the jobs array, as shown in the table above.