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
Get step-by-step solutions from verified subject matter experts
