Single Choice Easy

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

ID: #4909 Javascript Data Types MCQ 221 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

Explanation

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

Today: 0 answered · 0 correct
Save progress
Free account

Want to remember what you got wrong?

Create a free account in seconds to track your score, revisit mistakes and continue Computer Science and Engineering where you left off.

  • Save your progress & streak
  • Topic-wise quizzes & scores
  • Bookmark tricky questions
  • Printable MCQ sets
Practice smarterFree account · save progress
Sign up free

Share This Question

Challenge a friend or share with your study group.