diff --git a/src/variables.ts b/src/variables.ts index bd5e775..361ac5c 100644 --- a/src/variables.ts +++ b/src/variables.ts @@ -9,11 +9,13 @@ * 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 = "Humoud AlGhanim"; +let yearOfBirth: number = 1998; +let hobby: string = "Camping"; +let funFact: string = + "Was ranked 5th best boxer in Asia within my age group when I was 14"; +let image: string = "https://ibb.co/4Zv34sH8"; +const currentYear = new Date().getFullYear(); /** * Part 2: String Interpolation @@ -25,9 +27,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 ${currentYear - yearOfBirth}`; +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++; } function decrementBy1() { // decrement hackerScore by 1 👇🏻 + hackerScore--; } function incrementBy2() { // Increment hackerScore by 2 👇🏻 + hackerScore += 2; } function decrementBy2() { // decrement hackerScore by 2 👇🏻 + hackerScore -= 2; } // Ignore this part (: