Trying ES6 and came across this example:
var bob = {
_name: "Bob",
_friends: ["Pete", "Joe", "Larry"],
printFriends() {
this._friends.forEach(f =>
console.log(this._name + " knows " + f));
}
}
Console logging bob.printFriends() gives undefined.
printFriendsdoes returnundefined, so the result seems to be correct?