MCQ Single Best Answer Easy

QWhat does the following function do in JavaScript?
function getArea(radius) {
return Math.PI * radius * radius;
}

ID: #4910 Javascript Data Types MCQ 225 views
Question Info
#4910Q 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: Option A

Explanation

This function takes in a single argument, radius, and uses the Math.PI constant and the radius to calculate the area of a circle.

Share This Question

Challenge a friend or share with your study group.