Skip to content

Conversation

@shaghayeghfar
Copy link

@shaghayeghfar shaghayeghfar commented Oct 7, 2025

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

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).

@shaghayeghfar shaghayeghfar added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 7, 2025
@a-robson a-robson added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Oct 14, 2025
Copy link

@a-robson a-robson left a 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.

Comment on lines +8 to +10
let initials = firstName.charAt(0) + middleName.charAt(0) + lastName.charAt(0);

console.log(initials);

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.

Comment on lines +20 to +21
const dir = filePath.slice(0, lastSlashIndex);
const ext = base.slice(base.lastIndexOf("."));

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)

Comment on lines +3 to +5
let age =33;
age = age + 1;
console.log(age);

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.

Comment on lines +12 to +14
const cardNumber = 4533787178994213;
const last4Digits = cardNumber.toString().slice(-4);
console.log(last4Digits);

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.

Comment on lines +14 to +15
// a) How many function calls are there in this file? Write down all the lines where a function call is made :
//Answer : 5 functions

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!)

Copy link
Author

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.

Comment on lines 23 to +24
// d) Identify all the lines that are variable declarations
//Answer: line 1, 2, 6, 7

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.

@a-robson a-robson added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants