diff --git a/src/variables.ts b/src/variables.ts index bd5e775..e97e85f 100644 --- a/src/variables.ts +++ b/src/variables.ts @@ -15,20 +15,18 @@ let hobby: string; let funFact: string; let image: string; -/** - * 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 fullNameString: string; -let ageString: string; -let hobbyString: 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"; +let currentYear = 2025; +const your_Age = currentYear - yearOfBirth; +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 @@ -38,15 +36,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 👇🏻 }