r/JavaScriptTips • u/Key_Safety8433 • Jul 08 '23
HELP WITH CODING ROOMS
I’m doing the coding rooms free course and I’m stuck on this assignment. Instructions in the picture. Any help is appreciated
3
Upvotes
r/JavaScriptTips • u/Key_Safety8433 • Jul 08 '23
I’m doing the coding rooms free course and I’m stuck on this assignment. Instructions in the picture. Any help is appreciated
1
u/slam_the_damn_door Jul 08 '23
function greetByDefault(firstname, lastname){ if(lastname === undefined) lastname ='Doe';
return `Hi ${firstname} ${lastname}!'; }
Something like above, or if you wanna use defualt params:
function greetByDefault(firstname, lastname='doe'){ return `Hi ${firstname} ${lastname}!'; }