1
0
CompleteNodeJS/playground/2-arrow-function.js

25 lines
456 B
JavaScript
Raw Normal View History

2019-08-11 18:34:34 +00:00
// const square = function(x) {
// return x * x;
// }
// const square = (x) => {
// return x * x;
// }
// const square = (x) => x * x;
// console.log(square(2));
const event = {
name: 'Birthday Party',
guestList: ['Andrew', 'Jen', 'Mike'],
printGuestList() {
console.log('Guest list for ' + this.name);
this.guestList.forEach((guest) => {
console.log(guest + ' is attending ' + this.name);
})
}
}
event.printGuestList();