function main(greeting='Hello', object='World') { let output = `${greeting}, ${object}!`; console.log(output); return output; }
function main(greeting, language) {output = `${greeting}, ${language}!`;- function main(greeting='Hello', object='World') {
- let output = `${greeting}, ${object}!`;
- console.log(output);
- return output;
- }
Test.assertEquals("Hello, World!", main()); Test.assertEquals("Bonjour, World!", main("Bonjour")); Test.assertEquals("Bonjour, JavaScript!", main("Bonjour", "JavaScript"));
Test.assertEquals("Bonjour, JS!", main("Bonjour", "JS"));Test.assertEquals("Hello, JavaScript!", main("Hello", "JavaScript"));- Test.assertEquals("Hello, World!", main());
- Test.assertEquals("Bonjour, World!", main("Bonjour"));
- Test.assertEquals("Bonjour, JavaScript!", main("Bonjour", "JavaScript"));