Video 21
This commit is contained in:
parent
6528d7204a
commit
6fe77562a9
24
playground/2-arrow-function.js
Normal file
24
playground/2-arrow-function.js
Normal file
@ -0,0 +1,24 @@
|
||||
// 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();
|
Loading…
Reference in New Issue
Block a user