JS Coding Questions Logo
JS Coding Questions
#41🎯 Exercise💻 Code

JavaScript Coding Exercise 41

Advertisement

728x90
javascript
1function greet(greeting, name, message = greeting + " " + name) {
2
3console.log([greeting, name, message]);
4}
5
6greet("Hello", "John");
7
8greet("Hello", "John", "Good morning!");

Choose the correct output:

A
SyntaxError
B
['Hello', 'John', 'Hello John'], ['Hello', 'John', 'Good morning!']

Advertisement

Responsive Ad
40of86