I have a for loop and I would like to tap into an object inside the array I am looping. Specifically I would like to tap into the "Name" section of my objects to only console.log the names, not the whole array. This is the code... I am doing this with Mongoose but I don't think it has anything to do with my problem, I just wanted to add it tho.
const newCustomerNum2 = new customerList({
name: "John",
age: 32
});
customerList.find(function(err, customers) {
if (err) {
console.log(err);
} else {
for (var i = 0; i<customers.length; i++){
console.log(customers.name);
}
}
});