100 Days of Code: mappin

Such a wee snippit, but I fulfilled my goal. I made sammiches by mapping over an array of meats and adding concatenating little bun strings. I think in this case, the proper term is mayonnaising. 

var meats = [‘hamburger’, ‘roast beef’, ‘pulled pork’];

function makeSammich(){
 return meats.map(function(val, i){
   console.log(“bun ”+val+“ bun”);
 })
 return
}                  
makeSammich();

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s