JavaScript | JavaScript Basics | Question 8

Last Updated :
Discuss
Comments

What will happen when this code is executed?

JavaScript
function greet(name) {
    return "Hello, " + name;
}
console.log(greet("Alisha"));

The function will greet the name "Alisha"

The code will result in an error

"Hello, Alisha" will be logged in the console

Nothing will be logged

Share your thoughts in the comments