-
Notifications
You must be signed in to change notification settings - Fork 23
saw the task #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
saw the task #16
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,14 @@ | |
2. Use console.log() to output the value of each variable. | ||
********************************************************************************/ | ||
// TODO: ADD YOUR CODE BELOW | ||
let personName = "ali"; | ||
|
||
console.log(personName); | ||
let age = "15"; | ||
console.log(age); | ||
let isHappy = "true"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing for the boolean value, you should assign it directly without enclosing it in double quotation marks. Here's the corrected version of the code: |
||
|
||
console.log(isHappy); | ||
|
||
/******************************************************************************* | ||
Task 2 (Reassigning variables): | ||
|
@@ -24,7 +32,8 @@ | |
2. Use console.log o output the value of 'nickName' | ||
*******************************************************************************/ | ||
// TODO: ADD YOUR CODE BELOW | ||
|
||
let nickName = personName; | ||
console.log(nickName); | ||
/******************************************************************************* | ||
Task 3 (Naming variables): | ||
|
||
|
@@ -33,6 +42,9 @@ | |
2. Declare a variable that stores the age of a user. What name would you choose for this variable? | ||
*******************************************************************************/ | ||
// TODO: ADD YOUR CODE BELOW | ||
let favoriteMovie = "lion"; | ||
let userAge = "20"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good job for naming the variables, make sure the numeric values are assigned without enclosing them in double quotation marks. |
||
|
||
|
||
/******************************************************************************* | ||
Task 4 (String Concatenation): | ||
|
@@ -48,3 +60,7 @@ 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 = prompt("the letter"); | ||
let finalMsg = `${msg} And btw, Why are you happy?`; | ||
console.log(`Dear ${personName.toUpperCase()}, here's your message: ${finalMsg}`) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When declaring a variable that is meant to hold a numeric value, such as age in this case, you should assign it a numerical value directly without enclosing it in double quotation marks. Here's the corrected version of the code:
let age = 15;