From 6fe77562a915d590ed0796b6aeb8b74ae9a0abd0 Mon Sep 17 00:00:00 2001 From: Jason Williams Date: Sun, 11 Aug 2019 12:34:34 -0600 Subject: [PATCH] Video 21 --- playground/2-arrow-function.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 playground/2-arrow-function.js diff --git a/playground/2-arrow-function.js b/playground/2-arrow-function.js new file mode 100644 index 0000000..e277d9c --- /dev/null +++ b/playground/2-arrow-function.js @@ -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();