Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the following code - Update the condition to incorporate the .toUpperCase method === 'RUBY' this way, it doesn't matter if the user enters the

Given the following code - Update the condition to incorporate the .toUpperCase method === 'RUBY' this way, it doesn't matter if the user enters the answer in lowercase,the condition is passed since the answer is converted to upper case letters; therfore matching the string

// obtain a response from the user let answer = prompt('What programming language is the name of a gem?');

//just like let is used to declare variables, the let keyword is user for // a conditional statement

if ( answer === 'Ruby' )

//inside the parenthesis is the condition just // a simple test whose answer is either true or false in this example // the given answer must match exactly

// inside the braces is the code that runs only if the statement is true { document.write("

You are right, good thinking !

") //indenting the code mades it easier to read }

else { //this block of code will run only if the answer if NOT Ruby document.write("

Darn, your answer if not right!

") }

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

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions

Question

What are the transportation modes?

Answered: 1 week ago

Question

=+ How can they be incorporated into social media content?

Answered: 1 week ago