Make a function that will return a greeting statement that uses an input; your program should return, "Hello, (name) how are you doing today?".
[Make sure you type the exact thing I wrote or the program may not execute properly]
function greet(name){
return grt = 'Hello, '+name+' how are you doing today?';
}
문자열을 리턴하는 함수를 설계했다.
function greet(name){
return `Hello, ${name} how are you doing today?`;
}
function greet(name){
return "Hello, <name> how are you doing today?".replace("<name>", name);
}
.replace 메소드를 이용하여 함수를 설계했다.