1
0
CompleteNodeJS/playground/2-arrow-function.js
Jason Williams 6fe77562a9 Video 21
2019-08-11 13:47:41 -06:00

25 lines
456 B
JavaScript

// 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();