Skip to content

Conversation

@cmhorsey
Copy link

@cmhorsey cmhorsey commented May 8, 2024

Created three functions practicing for and while loops

Comment on lines +14 to +20
const thankYouCards = [];

function writeCards(array, event) {
for(let i =0; i < array.length; i++){
thankYouCards.push(`Thank you, ${array[i]}, for the wonderful ${event} gift!`);
}; return thankYouCards;
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const thankYouCards = [];
function writeCards(array, event) {
for(let i =0; i < array.length; i++){
thankYouCards.push(`Thank you, ${array[i]}, for the wonderful ${event} gift!`);
}; return thankYouCards;
};
function writeCards(array, event) {
let thankYouCards = [];
for(let i =0; i < array.length; i++){
thankYouCards.push(`Thank you, ${array[i]}, for the wonderful ${event} gift!`);
};
return thankYouCards;
};


function countDown(number){
while (number >= 0) {
console.log(number--);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants