From d7fd1d4f2bff107d985ed6a9725b88b8c7dd10cc Mon Sep 17 00:00:00 2001 From: Neil Barduson Date: Tue, 5 Sep 2017 15:20:18 -0500 Subject: [PATCH 1/2] updated to fat arrow functions, and replaced var with const and let for variabl declartions --- script.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/script.js b/script.js index 452c0ed..43590f1 100644 --- a/script.js +++ b/script.js @@ -1,21 +1,21 @@ -var logger = function() { - var message = 'hi'; +const logger = function() { + const message = 'hi'; console.log(message); }; -var looper = function() { - var message = 'I love JS!'; - for (var i = 0; i < 10; i++) { +const looper = () => { + const message = 'I love JS!'; + for (let i = 0; i < 10; i++) { console.log(message); } }; -var greet = function(name) { - var greeting = 'Hello ' + name + '!'; +const greet = (name) => { + const greeting = `Hello ${name}!`; console.log(greeting); }; -var yourName = 'put your name in here'; +const yourName = 'squeel'; logger(); looper(); From 0af422d5161f306c5dc43a5dca7b8f659ed5ce35 Mon Sep 17 00:00:00 2001 From: Neil Barduson Date: Tue, 5 Sep 2017 15:23:04 -0500 Subject: [PATCH 2/2] updated to fat arrow functions, and replaced var with const and let for variabl declartions --- script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script.js b/script.js index 43590f1..3dd2f40 100644 --- a/script.js +++ b/script.js @@ -1,4 +1,4 @@ -const logger = function() { +const logger = () => { const message = 'hi'; console.log(message); };