From bb67888fb0fe062f7d6c9621db3d33c5185205b4 Mon Sep 17 00:00:00 2001 From: saarahalkhamees Date: Thu, 17 Jul 2025 09:44:32 +0300 Subject: [PATCH 1/2] done task --- src/variables.ts | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/variables.ts b/src/variables.ts index bd5e775..e3c0d92 100644 --- a/src/variables.ts +++ b/src/variables.ts @@ -15,6 +15,13 @@ let hobby: string; let funFact: string; let image: string; +fullName = "sarah alkhamees"; +yearOfBirth = 1992; +hobby = "swimming"; +funFact = "curious"; +image = + "https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.planetware.com%2Fpictures%2Ffrance-f.htm&psig=AOvVaw3aJQnHoBy-XK-PBrG0u3Em&ust=1752596548321000&source=images&cd=vfe&opi=89978449&ved=0CBEQjRxqFwoTCPiNlofhvI4DFQAAAAAdAAAAABAE"; + /** * Part 2: String Interpolation * Create the following new variables that interpolate @@ -24,10 +31,11 @@ let image: string; * 2. ageString -> assign it: "I am {YOUR_AGE}"", and make sure you calculate your age from your year of birth * 3. hobbyString -> assign it: "My hobby is {YOUR_HOBBY}"" */ - -let fullNameString: string; -let ageString: string; -let hobbyString: string; +let currentYear = 2025; +const your_Age = currentYear - yearOfBirth; +let fullNameString = `my name is ${fullName}`; +let ageString = `i am ${yearOfBirth}`; +let hobbyString = `my hobby is ${hobby}`; /** * Part 3: Re-assignment @@ -38,15 +46,20 @@ let hackerScore = 0; function incrementBy1() { // Increment hackerScore by 1 👇🏻 + hackerScore = hackerScore + 1; } + function decrementBy1() { // decrement hackerScore by 1 👇🏻 + hackerScore = hackerScore - 1; } function incrementBy2() { + hackerScore = hackerScore + 2; // Increment hackerScore by 2 👇🏻 } function decrementBy2() { + hackerScore = hackerScore - 2; // decrement hackerScore by 2 👇🏻 } From e4811e4af6d5d4101220b34988a975662de55814 Mon Sep 17 00:00:00 2001 From: saarahalkhamees Date: Thu, 17 Jul 2025 18:34:29 +0300 Subject: [PATCH 2/2] done all --- src/variables.ts | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/variables.ts b/src/variables.ts index e3c0d92..e97e85f 100644 --- a/src/variables.ts +++ b/src/variables.ts @@ -22,21 +22,11 @@ funFact = "curious"; image = "https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.planetware.com%2Fpictures%2Ffrance-f.htm&psig=AOvVaw3aJQnHoBy-XK-PBrG0u3Em&ust=1752596548321000&source=images&cd=vfe&opi=89978449&ved=0CBEQjRxqFwoTCPiNlofhvI4DFQAAAAAdAAAAABAE"; -/** - * Part 2: String Interpolation - * Create the following new variables that interpolate - * the variables defined above into strings. - * - * 1. fullNameString -> assign it: "My name is {fullName}"" - * 2. ageString -> assign it: "I am {YOUR_AGE}"", and make sure you calculate your age from your year of birth - * 3. hobbyString -> assign it: "My hobby is {YOUR_HOBBY}"" - */ let currentYear = 2025; const your_Age = currentYear - yearOfBirth; -let fullNameString = `my name is ${fullName}`; -let ageString = `i am ${yearOfBirth}`; -let hobbyString = `my hobby is ${hobby}`; - +const fullNameString = `My name is ${fullName}`; +const ageString = `I am ${your_Age}`; +const hobbyString = `My hobby is ${hobby}`; /** * Part 3: Re-assignment * Increment your hacker score