Skip to content

Instantly share code, notes, and snippets.

@tripdog
Created June 17, 2021 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripdog/ffa7fb3fceea6fae446677bddf5c70ba to your computer and use it in GitHub Desktop.
Save tripdog/ffa7fb3fceea6fae446677bddf5c70ba to your computer and use it in GitHub Desktop.
Create a function called greetAliens that taks an array and adds a greeting to the aliens

Create a function called greetAliens that taks an array and adds a greeting to the aliens.

function greetAliens(aliens) {
    let greeting = []
    for (let i = 0; i < aliens.length; i++) {
      greeting.push("Greetings " + aliens[i]);
    }
    return greeting
}
console.log(greetAliens(["SpaceKing", "Wegord", "Klingon", "Blorgous", "Vulcan"]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment