I can't seem to grasp how specific array values are called and displayed:
I've included some questions inside the code. Please review and explain why the array displays one result within the function, but a different result outside of it. You can run the code on websites like repl.it
var passengers = [ ["Thomas", "Meeks"],
["Gregg", "Pollack"],
["Christine", "Wong"],
["Dan", "McGaw"] ];
var results = passengers.map(function (array) {
// This section prints out only the first names--the entire first column. Why does this happen?
console.log(array[0]);
});
console.log(); // Adding empty space
// Why does this next line print only the first row of passengers as expected, while array[0] displayed all first column data?
console.log(passengers[0]);