JavaScript MCQ Javascript Data Types MCQ Question #4889
Single Choice Easy

QWhat is the result of the following code?
var str = "Hello";
console.log(str.toUpperCase());

ID: #4889 Javascript Data Types MCQ 213 views
Question Info
#4889Q ID
EasyDifficulty
Javascript Data Types MCQTopic

Choose the Best Option

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

  • A "hello"
  • B "HELLO"
  • C "Hello"
  • D TypeError
Correct Answer

Explanation

The toUpperCase() method in JavaScript is a string method that converts all the characters in a string to uppercase.
In this case, the toUpperCase() method is called on the string "Hello", which converts all the characters in the string to uppercase.
The result is the string "HELLO", which is logged to the console.

Share This Question

Challenge a friend or share with your study group.