2.
Which method can be used to convert a string to uppercase in JavaScript?
toLowerCase()
toUpperCase()
convert()
upper()
Correct: B
In JavaScript, the toUpperCase() method is used to convert a string to uppercase. It returns a new string with all the alphabetic characters converted to uppercase. Note that the toUpperCase() method does not modify the original string, but instead, it creates a new string with the converted characters.