Answers for "default in javascript"

1

default in javascript

const greet = (message = 'Hello World!') => console.log(message);

greet(); // prints 'Hello World!'
greet('Hello! Does this answer your question?') // prints 'Hello! Does this answer your question?'
Posted by: Guest on May-07-2021
-1

default javascript

function say(message='Hi') {
    console.log(message);
}

say(); // 'Hi'
say('Hello') // 'Hello'
Posted by: Guest on August-10-2021

Code answers related to "default in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language