From 695f4b121fc564e680e924f6f910113680626f2f Mon Sep 17 00:00:00 2001 From: NetMan <13informatyka14@gmail.com> Date: Sat, 30 Dec 2023 15:24:08 +0100 Subject: [PATCH] Completed exercise 04 Probably should've commited steps... --- 04-direction-follow/follow.js | 59 +++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/04-direction-follow/follow.js b/04-direction-follow/follow.js index 3ac88bc..e1ccfd9 100644 --- a/04-direction-follow/follow.js +++ b/04-direction-follow/follow.js @@ -13,14 +13,14 @@ */ // code to be deleted -const birthYear = 1948; -const thisYear = 1965; -const firstName = "Carlos"; -const lastName = "Stevenson"; +// const birthYear = 1948; +// const thisYear = 1965; +// const firstName = "Carlos"; +// const lastName = "Stevenson"; -const greeting = "Hello! My name is " + firstName + " " + lastName + " and I am " + (thisYear - birthYear) + " years old."; +// const greeting = "Hello! My name is " + firstName + " " + lastName + " and I am " + (thisYear - birthYear) + " years old."; -console.log(greeting); +// console.log(greeting); /* @@ -54,6 +54,17 @@ console.log(greeting); //===== Your code goes here ================= +const birthYear = 1948; +const thisYear = 1965; +const firstName = "Carlos"; +const lastName = "Stevenson"; +const fullName = `${firstName} ${lastName}`; +const age = thisYear - birthYear; + +let greeting = `Hello! My name is ${fullName} and I am ${age} years old.`; + +console.log(greeting); + /* @@ -87,25 +98,25 @@ console.log(greeting); // Test Step 2: -module.exports = { - testGroup: "a", - greeting, - birthYear, - thisYear, - firstName, - lastName -} +// module.exports = { +// testGroup: "a", +// greeting, +// birthYear, +// thisYear, +// firstName, +// lastName +// } // Test Step 3: (Don't forget to comment out lines under Test Step 2) -// module.exports = { -// testGroup: "b", -// greeting, -// birthYear, -// thisYear, -// firstName, -// lastName, -// fullName, -// age -// } +module.exports = { + testGroup: "b", + greeting, + birthYear, + thisYear, + firstName, + lastName, + fullName, + age +}