Single Choice Easy

QWhat does the following function do in JavaScript?
function toUpperCase(str) {
return str.toUpperCase();
}


ID: #4911 Javascript Data Types MCQ 296 views
Question Info
#4911Q ID
EasyDifficulty
Javascript Data Types MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A calculates the area of a circle
  • B converts a string to uppercase
  • C checks if a string is a palindrome
  • D sorts an array in ascending order
Correct Answer

Explanation

This function takes in a single argument, str, and uses the toUpperCase() method to convert the string to uppercase.

Share This Question

Challenge a friend or share with your study group.