From e70408003b7ebc66dde9a180f648ed13955127aa Mon Sep 17 00:00:00 2001 From: Raghad Butaiban Date: Sun, 9 Mar 2025 13:43:02 +0300 Subject: [PATCH] Day4_task1 done --- src/variables.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/variables.ts b/src/variables.ts index bd5e775..a29ec76 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 = "Raghad Butaiban"; +let yearOfBirth: number = 1993; +let hobby: string = "Coding"; +let funFact: string = "I usually start my day with a cup of coffee"; +let image: string = "https://icon-library.com/images/user-png-icon/user-png-icon-16.jpg"; /** * Part 2: String Interpolation @@ -25,9 +25,9 @@ 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 = `I am ${new Date().getFullYear() - yearOfBirth}`; +let hobbyString: string = `My hobby is ${hobby}`; /** * Part 3: Re-assignment @@ -38,16 +38,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 (: