Skip to content
Open
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
17 changes: 17 additions & 0 deletions variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
2. Use console.log() to output the value of each variable.
********************************************************************************/
// TODO: ADD YOUR CODE BELOW
let personName = "Hamza";
let age = 12;
let isHappy = false;
console.log(personName);
console.log(age);
console.log(isHappy);

/*******************************************************************************
Task 2 (Reassigning variables):
Expand All @@ -24,6 +30,9 @@
2. Use console.log o output the value of 'nickName'
*******************************************************************************/
// TODO: ADD YOUR CODE BELOW
const nickName = personName;

console.log(nickName);

/*******************************************************************************
Task 3 (Naming variables):
Expand All @@ -33,6 +42,8 @@
2. Declare a variable that stores the age of a user. What name would you choose for this variable?
*******************************************************************************/
// TODO: ADD YOUR CODE BELOW
const favMovie = "Friends";
const userAge = 101;

/*******************************************************************************
Task 4 (String Concatenation):
Expand All @@ -48,3 +59,9 @@ Steps:
- Print the final message to the console, including the personName in uppercase in this format `Dear personName_VALUE, here's your message: finalMsg_VALUE.`.
*******************************************************************************/
// TODO: ADD YOUR CODE BELOW
let msg;
msg = prompt("Please enter a message");
let finalMsg = "And btw, Good for you. There's nothing to be happy about.";
console.log(
`Dear ${personName.toUpperCase()}, here's your message: ${msg} ${finalMsg}.`
);