Skip to content
Open

done #19

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions src/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 👇🏻
}

Expand Down