-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
WM5 | Zahra-Khademi | Module-JS1 | Week-1 #80
base: main
Are you sure you want to change the base?
Conversation
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.
Some excellent work Zahra, keep it up!
@@ -1,4 +1,5 @@ | |||
// trying to create an age variable and then reassign the value by 1 | |||
|
|||
const age = 33; | |||
let age = 33; | |||
age = age + 1; |
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.
very good with this reassignment! are you aware of this shorter way to write this line?
const cityOfBirth = "Bolton"; | ||
console.log(`I was born in ${cityOfBirth}`); |
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.
well done
const last4Digits = cardNumber.slice(-4); | ||
|
||
// The last4Digits variable should store the last 4 digits of cardNumber | ||
// However, the code isn't working | ||
// Make and explain a prediction about why the code won't work | ||
// Then try updating the expression last4Digits is assigned to, in order to get the correct value | ||
|
||
Slice() method is a part of a string, not a number. CardNumber becomes a string when enclosed in single quotations. |
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.
Brilliant explanation, but just remember .slice is not part of a string. Instead, it extracts a specified part of a string.
week-1/errors/4.js
Outdated
const twelveClockTime = "20:53"; | ||
const twentyFourhourClockTime = "08:53"; |
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.
Wonderful work!
Just change twentyFourhourClockTime to twentyFourHourClockTime <-- This is known as camelCase
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.
well done!
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.
Thank you Marcus. Done!
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.