Completed exercise 04

Probably should've commited steps...
This commit is contained in:
NetMan 2023-12-30 15:24:08 +01:00
parent 6c3c3f2de6
commit 695f4b121f
1 changed files with 35 additions and 24 deletions

View File

@ -13,14 +13,14 @@
*/ */
// code to be deleted // code to be deleted
const birthYear = 1948; // const birthYear = 1948;
const thisYear = 1965; // const thisYear = 1965;
const firstName = "Carlos"; // const firstName = "Carlos";
const lastName = "Stevenson"; // 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 ================= //===== 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: // Test Step 2:
module.exports = { // module.exports = {
testGroup: "a", // testGroup: "a",
greeting, // greeting,
birthYear, // birthYear,
thisYear, // thisYear,
firstName, // firstName,
lastName // lastName
} // }
// Test Step 3: (Don't forget to comment out lines under Test Step 2) // Test Step 3: (Don't forget to comment out lines under Test Step 2)
// module.exports = { module.exports = {
// testGroup: "b", testGroup: "b",
// greeting, greeting,
// birthYear, birthYear,
// thisYear, thisYear,
// firstName, firstName,
// lastName, lastName,
// fullName, fullName,
// age age
// } }