Home / Javascript Tips Generated By ChatGPT / Setting Default Parameter Values in Javascript Set default values for function parameters. Source Code function greet(name = 'Guest') { console.log('Hello ' + name); } greet(); // "Hello Guest" greet('John'); // "Hello John"