From 2c038eb051d411b801ec6b9c806cb8adbce6e21d Mon Sep 17 00:00:00 2001 From: bequit1 Date: Tue, 15 Jul 2025 20:07:59 +0300 Subject: [PATCH] Finish --- src/variables.ts | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/variables.ts b/src/variables.ts index bd5e775..dfe683d 100644 --- a/src/variables.ts +++ b/src/variables.ts @@ -9,11 +9,11 @@ * 5. image -> assign it a value of a url of your image or ant image that represents you online */ -let fullName: string; -let yearOfBirth: number; -let hobby: string; -let funFact: string; -let image: string; +let fullName: string = "Abdulaziz"; +let yearOfBirth: number = 2002; +let hobby: string = "swimming"; +let funFact: string = "I love coding challenges"; +let image: string = "./1102007.jpg"; /** * Part 2: String Interpolation @@ -25,9 +25,11 @@ let image: string; * 3. hobbyString -> assign it: "My hobby is {YOUR_HOBBY}"" */ -let fullNameString: string; -let ageString: string; -let hobbyString: string; +let fullNameString: string = `My name is ${fullName}`; +let ageString: string = `Im ${ + new Date().getFullYear() - yearOfBirth +} years old`; +let hobbyString: string = `My hobby is ${hobby}`; /** * Part 3: Re-assignment @@ -38,16 +40,20 @@ let hackerScore = 0; function incrementBy1() { // Increment hackerScore by 1 👇🏻 + hackerScore += 1; } function decrementBy1() { // decrement hackerScore by 1 👇🏻 + hackerScore -= 1; } function incrementBy2() { // Increment hackerScore by 2 👇🏻 + hackerScore += 2; } function decrementBy2() { // decrement hackerScore by 2 👇🏻 + hackerScore -= 2; } // Ignore this part (: