From 0c890ef5440ee49c2625b4139126043837ed3fa6 Mon Sep 17 00:00:00 2001 From: SheikhaAlenezi Date: Tue, 22 Jul 2025 16:06:22 +0300 Subject: [PATCH] done --- src/variables.ts | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/src/variables.ts b/src/variables.ts index bd5e775..8a80e3b 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 = "Sheikha Alenezi"; +let yearOfBirth: number = 1998; +let hobby: string = "sleep"; +let funFact: string = "I can speak three languages."; +let image: string = "https://example.com/my-image.jpg"; /** * Part 2: String Interpolation @@ -25,10 +25,15 @@ let image: string; * 3. hobbyString -> assign it: "My hobby is {YOUR_HOBBY}"" */ -let fullNameString: string; -let ageString: string; -let hobbyString: string; +let currentYear: number = new Date().getFullYear(); +let age: number = currentYear - yearOfBirth; +let fullNameString: string = `My name is ${fullName}`; +let ageString: string = `I am ${age}`; +let hobbyString: string = `My hobby is ${hobby}`; +console.log(fullNameString); +console.log(ageString); +console.log(hobbyString); /** * Part 3: Re-assignment * Increment your hacker score @@ -38,18 +43,34 @@ let hackerScore = 0; function incrementBy1() { // Increment hackerScore by 1 👇🏻 + hackerScore += 1; } +incrementBy1(); +console.log(hackerScore); + function decrementBy1() { // decrement hackerScore by 1 👇🏻 + hackerScore -= 1; } +decrementBy1(); +console.log(hackerScore); + function incrementBy2() { // Increment hackerScore by 2 👇🏻 + hackerScore += 2; } +incrementBy2(); +console.log(hackerScore); + function decrementBy2() { // decrement hackerScore by 2 👇🏻 + hackerScore -= 2; } +decrementBy2(); +console.log(hackerScore); + // Ignore this part (: export { fullName,