Created
August 1, 2014 03:00
-
-
Save macikokoro/ac3a169c2be7068f280a to your computer and use it in GitHub Desktop.
Mapping a function to unite first and last names into one cell.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var passengers = [ ["Thomas", "Meeks"], | |
["Gregg", "Pollack"], | |
["Christine", "Wong"], | |
["Dan", "McGaw"] ]; | |
var modifiedNames = passengers.map(function(cell){ return cell[0] + ' ' + cell[1];}); | |
console.log(modifiedNames); | |
//This will log: ["Thomas Meeks", "Gregg Pollack", "Christine Wong", "Dan McGaw"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment