Question: Suppose you have assigned a string entered by the user to the groceryList variable in JavaScript. You want to ensure that the string held by

Suppose you have assigned a string entered by the user to the groceryList variable in JavaScript. You want to ensure that the string held by the groceryList variable uses all lowercase letters. How can you accomplish this?

a. You cannot do this in JavaScript because strings are immutable.

b. execute the statement groceryList.toLowerCase();

c. call the trim() method on the groceryList variable

d. execute the statement groceryList = groceryList.toLowerCase();

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!