From fedd8c6c2c84fb87cfb3958fc9ccecc9c3579dd9 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Fri, 1 Dec 2017 00:32:51 -0500 Subject: [PATCH] arrow function --- playground/arrow-function.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 playground/arrow-function.js diff --git a/playground/arrow-function.js b/playground/arrow-function.js new file mode 100644 index 0000000..986022b --- /dev/null +++ b/playground/arrow-function.js @@ -0,0 +1,17 @@ +var square = x => x * x; +console.log(square(9)); + +var user = { + name: "Tyrel", + sayHi: () => { + console.log(arguments); + console.log(`Hi I'm ${this.name}.`); + }, + sayHiAlt () { + console.log(arguments); + console.log(`Hi I'm ${this.name}.`); + } +} + +user.sayHi(1,2,3); +user.sayHiAlt(1,2,3);