Skip to content

Instantly share code, notes, and snippets.

@goodbedford
Last active August 6, 2016 06:36
Show Gist options
  • Save goodbedford/0070be4ba069dc58595e710c64d0bfff to your computer and use it in GitHub Desktop.
Save goodbedford/0070be4ba069dc58595e710c64d0bfff to your computer and use it in GitHub Desktop.
var foodOrder = ["fries", "shake", "pickles", "polenta", "salad"];
var happyFood = [];
//make each food order item print happy
// map returns an new array with changed items.
happyFood = foodOrder.map(function(item) {
return ("Happy-" + item);
});
console.log(happyFood)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment