-
-
Notifications
You must be signed in to change notification settings - Fork 546
London | 26-ITP-Sep | Abakar Souleyman | Sprint 2 | Coursework #1530
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?
Changes from all commits
c32281a
5eefab9
689213b
1716943
d8c52f7
52e2cb3
64003b5
7fdd13f
46da3bd
8cc6b17
f33a665
60283cb
fb61446
581eb7b
b5135ac
89a16d1
6067629
a57dcc9
cc7acf9
be74be1
f142f39
304536e
1295cd4
fa97c40
9e45bc7
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 |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| This is just an instruction for the first activity - but it is just for human consumption | ||
| We don't want the computer to run these 2 lines - how can we solve this problem? | ||
| // This is just an instruction for the first activity - but it is just for human consumption | ||
| // We don't want the computer to run these 2 lines - how can we solve this problem? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,8 @@ | ||
| // trying to create an age variable and then reassign the value by 1 | ||
|
|
||
| const age = 33; | ||
| //const age = 33; | ||
| //age = age + 1; | ||
|
|
||
| let age = 33; | ||
|
Contributor
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. The fix is right and the file runs now. This section also asks you to interpret the error and explain why it happened, and there is nothing written down here yet. What did node print before you changed it, and why?
Author
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. I didn’t see the section asking me to explain the error, so perhaps I’m looking in the wrong place.
Contributor
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. You were not looking in the wrong place. This file does not ask for it anywhere, only the section heading in the Sprint-2 README does. No apology needed. Your explanation here is right, so that is done. |
||
| age = age + 1; | ||
| console.log(age); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| // Currently trying to print the string "I was born in Bolton" but it isn't working... | ||
| // what's the error ? | ||
| //'cityOfBirth' cannot access before initialization | ||
|
|
||
| // console.log(`I was born in ${cityOfBirth}`); | ||
| // const cityOfBirth = "Bolton"; | ||
|
|
||
| console.log(`I was born in ${cityOfBirth}`); | ||
| const cityOfBirth = "Bolton"; | ||
| console.log(`I was born in ${cityOfBirth}`); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,18 @@ | ||
| const cardNumber = 4533787178994213; | ||
| // const cardNumber = 4533787178994213; | ||
| // const last4Digits = cardNumber.slice(-4); | ||
|
|
||
| const cardNumber = "4533787178994213"; | ||
| const last4Digits = cardNumber.slice(-4); | ||
| console.log(last4Digits); | ||
|
|
||
| // The last4Digits variable should store the last 4 digits of cardNumber | ||
| // However, the code isn't working | ||
|
|
||
| // Before running the code, make and explain a prediction about why the code won't work | ||
| //slice() not work with number | ||
|
|
||
| // Then run the code and see what error it gives. | ||
| //cardNumber.slice is not a function | ||
|
|
||
| // Consider: Why does it give this error? Is this what I predicted? If not, what's different? | ||
| // Then try updating the expression last4Digits is assigned to, in order to get the correct value |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,5 @@ | ||
| const 12HourClockTime = "8:53pm"; | ||
| const 24hourClockTime = "20:53"; | ||
| // const 12HourClockTime = "8:53pm"; | ||
| // const 24hourClockTime = "20:53"; | ||
|
|
||
| const ClockTime12Hour = "8:53pm"; | ||
|
Contributor
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. The renaming is right and the file runs. Same as
Author
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. Node returned SyntaxError: Invalid or unexpected token. Both variable names started with a number, which JavaScript does not allow.
Contributor
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 here, and your explanation is correct. Nothing else needed on this one. |
||
| const ClockTime24Hour = "20: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.
This file does not run, check age declaration
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.
Corrected. Thank you