You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Object from anywhere we want pass to functionsconstargs={firstName: "john",lastName : "doe",username : "jDoe",email : "[email protected]",password : 0000};
practises
Bad Code
/** * Parameters: * firstName, * lastName, * userName, * email, * password (default value is 1234) */constuserAgent=(firstName,lastName,username,email,password=1234)=>{return` user: ${firstName}${lastName} Username: @${username} by ${email} PASSWORD: ${password}`;};
Best Code
constuserAgent=({
firstName,
lastName,
username,email: mail,// give `email` object as `mail` variable in function
password =1234// default value is 1234})=>{return` user: ${firstName}${lastName} Username: @${username} by ${mail} PASSWORD: ${password}`;};