Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Upgrade Migration And Transformation Tips And Techniques

Authors: Edward Whalen ,Jim Czuprynski

1st Edition

0071846050, 978-0071846059

More Books

Students also viewed these Databases questions

Question

Methods of Delivery Guidelines for

Answered: 1 week ago