Explain how to change the case of a variable's value ?using the toLowerCase() or toUpperCase() method.
What will be an ideal response?
To change the case of letters in a string, you use the toLowerCase() and toUpperCase() methods of theStringclass. ThetoLowerCase() methodconverts a text string to lowercase, whereas thetoUpperCase() methodconverts a text string to uppercase. You append either method to a string or variable containing the text whose case you want to change. For example, the following code uses the toUpperCase()method to print the contents of theagencyvariable ("noaa") in uppercase letters ("NOAA"): var agency ="noaa"; agencyName.innerHTML = agency.toUpperCase(); // browser displays "NOAA" // but value of agency is still "noaa"Note that the toUpperCase() method in the preceding statement does not convert the contents of theagencyvariable to uppercase letters; it only prints the text in uppercase letters. If you want to change the contents of a variable to upper- or lowercase letters, you must assign the value returned from thetoLowerCase()ortoUpperCase()method to that variable or to a different variable. The following statements demonstrate how to change the contents of theagencyvariable to uppercase letters: var agency ="noaa"; agency = agency.toUpperCase(); // value of agency is "NOAA" agencyName.innerHTML = agency; // browser displays "NOAA"?
You might also like to view...
?Case 1-1Casey is learning about the types of servers and more powerful computers available. She has asked her friend Burt, an expert on computers and its uses, to quiz her.Burt describes an incredibly expensive computer designed to focus all of its computing power on one specific task at a time that can handle applications requiring speed, accuracy, and processing capabilities. Casey identifies the type of computer to be a(n) _____.
A. ?wireframe computer B. ?supercomputer C. ?mainframe computer D. ?enterprise-class computer
A computer's operating system is loaded into memory during the eviction process.
Answer the following statement true (T) or false (F)
Consider an Account class and a TransactionActivity class in a banking system.
a. Posit ODMG ODL class de?nitions for them. The Account class must include a relationship to the set of objects in the TransactionActivity class corresponding to the deposit and withdraw transactions executed against that account. b. Give an example of a database instance satisfying that description. c. Write an OQL query against that database that will return the account numbers of all accounts for which there was at least one withdrawal of more than $10,000.
Function calls start with the function name and are followed by the arguments (which can be constants or variables) in parentheses.
Answer the following statement true (T) or false (F)