MCQ Single Best Answer Easy

QWhat does the following function do in JavaScript?
function greet(name) {
return "Hello, " + name + "!";
}

ID: #4909 Javascript Data Types MCQ 164 views
Question Info
#4909Q ID
EasyDifficulty
Javascript Data Types MCQTopic

Choose the Best Option

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

  • A greets the user by name
  • B calculates the area of a circle
  • C converts a string to uppercase
  • D checks if a string is a palindrome
Correct Answer: Option A

Explanation

This function takes in a single argument, name, and returns a greeting string that includes the name.

Share This Question

Challenge a friend or share with your study group.