London | 26-ITP-Feb | Shuheda Begum | Sprint 1 | Coursework#1066
London | 26-ITP-Feb | Shuheda Begum | Sprint 1 | Coursework#1066codebyshay wants to merge 0 commit intoCodeYourFuture:mainfrom
Conversation
Sprint-1/2-mandatory-errors/3.js
Outdated
| const cardNumber = 4533787178994213; | ||
| const last4Digits = cardNumber.slice(-4); | ||
| // Currently trying to print the string "I was born in Bolton" but it isn't working... | ||
| // what's the error ? | ||
|
|
||
| // 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 | ||
| // Then run the code and see what error it gives. | ||
| // 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 | ||
| const cityOfBirth = "Bolton"; | ||
| console.log(`I was born in ${cityOfBirth}`); | ||
|
|
||
| // The error happens because cityOfBirth is used before it is defined. JavaScript | ||
| // runs code from top to bottom, so the variable must be declared first. No newline at end of file |
There was a problem hiding this comment.
The original content in this file was replaced with the content meant for 2.js.
Can you restore the original content and fix the error ?
|
I don't see any new commits on this PR branch. |
|
Sorry @cjyuan I was having issues pushing the commit through. All sorted now. You should be able to see the commits now. Thank you. |
|
The changed files in this PR don't match what is expected for this task. Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints. Please review the changed files tab at the top of the page, we are only expecting changes in this directory: If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
|
The changed files in this PR don't match what is expected for this task. Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints. Please review the changed files tab at the top of the page, we are only expecting changes in this directory: If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
|
Something went wrong. All changes are now gone when you make a force-pushed. I hope you have a backup. In case you need to find the content before the forced pushed, you can find them here: |
Learners, PR Template
Self checklist
Changelist
Completed all task required in Sprint 1
Questions
No questions.