Skip to content
Closed
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
24 changes: 16 additions & 8 deletions src/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "Lolwa Alromi and Razan Alkhateeb";
let yearOfBirth: number= 2001;
let hobby: string= "cooking";
let funFact: string = "Graduated from KUNIV";
let image: string ="https://th.bing.com/th?id=OIP.GqGVPkLpUlSo5SmeDogUdwHaHa&w=250&h=250&c=8&rs=1&qlt=90&o=6&pid=3.1&rm=2";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you have prettier activated on VSCode.
How did I know? Because there's a space missing between = and " 😀


/**
* Part 2: String Interpolation
Expand All @@ -24,10 +24,11 @@ let image: string;
* 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}""
*/
const d : Date = new Date();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's preferable to give variables meaningful names:

const todaysDate: Date = new Date();

let fullNameString: string = `My name is ${fullName}`;

let fullNameString: string;
let ageString: string;
let hobbyString: string;
let ageString: string = `I am ${d.getFullYear() - yearOfBirth}`;
let hobbyString: string = `My hobby is ${hobby}`;

/**
* Part 3: Re-assignment
Expand All @@ -38,16 +39,23 @@ let hackerScore = 0;

function incrementBy1() {
// Increment hackerScore by 1 👇🏻
// hackerScore++;
// console.log(hackerScore)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out code (also called "dead code") should be removed from the file before committing

return hackerScore++ ;
}
function decrementBy1() {
// decrement hackerScore by 1 👇🏻
return hackerScore--;
}

function incrementBy2() {
// Increment hackerScore by 2 👇🏻
return hackerScore+=2;
}
function decrementBy2() {
// decrement hackerScore by 2 👇🏻
return hackerScore-=2;

}

// Ignore this part (:
Expand Down