frontend-challenges
frontend-challenges copied to clipboard
115 - forEach and this - javascript
index.js
let group = {
title: "Our Group",
students: ["John", "Pete", "Alice"],
showList() {
const that = this;
this.students.forEach(function(student) {
console.log(that.title + ': ' + student);
});
}
};
export { group };