Hello everyone
i wanted to produce a unique message and append that message to the new created array but when i call the function its just create a message for the first Array name
here is my code :
const writeCards = (arr,event) => {
const messages = []
for(let i = 0; i < arr.length;i++) {
const greetingMessage = `Thank you, ${arr[i]}, for the wonderful ${event} gift!`
messages.push(greetingMessage)
return messages
}
}
console.log(writeCards(["Charlie", "Samip", "Ali"], "birthday"))
any Hint will be appreciated.