-
-
Notifications
You must be signed in to change notification settings - Fork 262
London | 25-ITP-SEP | Shaghayegh Shirinfar| Sprint 1 | coursework/sprint-1 #738
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?
London | 25-ITP-SEP | Shaghayegh Shirinfar| Sprint 1 | coursework/sprint-1 #738
Conversation
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. 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). |
a-robson
left a comment
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.
Great work. Sometimes your explanations could be a bit fuller but you demonstrate a good grasp of the material.
| let initials = firstName.charAt(0) + middleName.charAt(0) + lastName.charAt(0); | ||
|
|
||
| console.log(initials); |
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.
Nice work! You're right to use charAt(0) here. While you can also access the first character with bracket notation (firstName[0]), I prefer your method because charAt() is the more explicit and safer choice—it returns an empty string for out-of-bounds access rather than undefined.
| const dir = filePath.slice(0, lastSlashIndex); | ||
| const ext = base.slice(base.lastIndexOf(".")); |
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.
Works great. However it's good to get in the habit of checking the correctness of your code with a test. At this stage you could do that just with a couple of console log statements (later on you'll learn about using the assert keyword and and automated testing)
| let age =33; | ||
| age = age + 1; | ||
| console.log(age); |
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.
It's good you know how to fix the problem but you don't explain what was wrong with the original code.
| const cardNumber = 4533787178994213; | ||
| const last4Digits = cardNumber.toString().slice(-4); | ||
| console.log(last4Digits); |
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.
Again you fix the problem but don't explain what was wrong in the first place.
| // a) How many function calls are there in this file? Write down all the lines where a function call is made : | ||
| //Answer : 5 functions |
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.
Five functions is correct but you should say what lines they are on (otherwise it could just be a lucky guess!)
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.
Dear Andrew,
Thank you very much for reviewing my assignment and for all your helpful feedback. I really appreciate your time and effort. I will make sure to follow your advice, and I now have a better understanding of where I went wrong.
Many thanks again for your support.
| // d) Identify all the lines that are variable declarations | ||
| //Answer: line 1, 2, 6, 7 |
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.
Are you miscounting? 6 is a blank line.
Learners, PR Template
Self checklist