Answered step by step
Verified Expert Solution
Question
1 Approved Answer
var item = prompt(Choose an item to pick up: ); if(item==1) item=Food; else if(item==2) item=Clothes; else if (item == 3) item = Horses; else if
var item = prompt("Choose an item to pick up: "); if(item==1) item="Food"; else if(item==2) item="Clothes"; else if (item == 3) item = "Horses"; else if (item == 4) item = "Weapons"; else if (item == 5) item = "Wine";
1. Change the code so its not comparing to a number but instead to a string.
2. Change the code so the value is not a name but instead put it on the array
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started