Home / Javascript Tips Generated By ChatGPT / Setting Default Parameter Values in Functions in Javascript Set default values for function parameters to avoid undefined values. Source Code function greet(name = 'Guest') { console.log(`Hello, ${name}!`); } greet();