var position = prompt("position:");
var manager = ["John", "Alex", "Joe"];
var admin = ["Texas", "Jesus", "Rick"];
var tech = ["Nexus", "Thomas", "Fred"]
if (position == manager) {
alert("manager")}
if (position == admin) {
alert("admin")}
if (position == tech) {
alert("tech")
}
else {
alert("Incorrect position")
}
I would like to ask how it is possible to this program work. When I will enter in prompt John I would like to get alert manager when I will enter in prompt Rick I would like to have alert tech etc...
And also if I will enter something what is unknown random value it will get me Incorrect position.
Also I would like to ask if there is way when I will enter in prompt for example jOHN or john it will work. I am total beginner in JS and coding.