Skip to content

West Midlands | 26-Jan-ITP | Fida H Ali Zada | Sprint 1 | coursework/sprint-1#929

Closed
alizada-dev wants to merge 7 commits into
CodeYourFuture:mainfrom
alizada-dev:coursework/sprint-1
Closed

West Midlands | 26-Jan-ITP | Fida H Ali Zada | Sprint 1 | coursework/sprint-1#929
alizada-dev wants to merge 7 commits into
CodeYourFuture:mainfrom
alizada-dev:coursework/sprint-1

Conversation

@alizada-dev

Copy link
Copy Markdown

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

Changelist

I created a new branch 'coursework/sprint-1' from the main branch and completed all the coursework in the sprint-1 folder.

@alizada-dev alizada-dev added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 4, 2026
Comment thread Sprint-1/1-key-exercises/1-count.js
Comment thread Sprint-1/1-key-exercises/3-paths.js Outdated
const dir = ;
const ext = ;
const dir = filePath.slice(1, lastSlashIndex);
const ext = filePath.slice(lastSlashIndex + 5);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you express the statement on line 21 so that it works for any path?
For example, "/tmp/my-project/package.json"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if you can show the new code here so that I don't have to locate the code in the file.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const ext = filePath.split('/').pop().split('.').pop();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This work but it seems a bit overdone. Can you explain how this expression work?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sir. It is a bit overdone, but I could not find another solution because I didn't use AI.

So, this part filePath.split('/'), splits the whole file path that has slashes. And pop() takes out the last part, which in this example is package.json. Again, we split this part that has a dot. In this case, it becomes "package" "json". Finally, the last pop() will take the ext, which is json.

So, it works for all different paths.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more direct approach is to use filePath.lastIndexOf(). The original code has illustrated how to use it.

Why don't you use AI? It's ok to use AI, especially when you had already figured out an approach, to learn how else you could solve the problem.

Comment thread Sprint-1/1-key-exercises/4-random.js Outdated
Comment thread Sprint-1/3-mandatory-interpret/1-percentage-change.js
Comment thread Sprint-1/3-mandatory-interpret/3-to-pounds.js Outdated
Comment thread Sprint-1/4-stretch-explore/chrome.md Outdated
Comment thread Sprint-1/4-stretch-explore/objects.md Outdated
@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 12, 2026
@alizada-dev alizada-dev added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Feb 14, 2026
@cjyuan

cjyuan commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

Can you respond to each of my comment/question so that I don't have to search your code to find what you have changed?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 14, 2026
@alizada-dev alizada-dev added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Feb 14, 2026
@cjyuan

cjyuan commented Feb 15, 2026

Copy link
Copy Markdown
Contributor

Software development is not just about writing code that works.
It's also important to know the programming terminology so that you can more effectively communicate with developers.

Can you continue to respond to comments in those unresolved conversation?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 15, 2026
@alizada-dev

Copy link
Copy Markdown
Author

Yes, sir. I just got time to open my laptop. I am replying now. Thank you for pointing out those points.

@alizada-dev alizada-dev added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Feb 15, 2026
@cjyuan

cjyuan commented Feb 15, 2026

Copy link
Copy Markdown
Contributor

All comments addressed. Well done, and keep up the good work!

@cjyuan cjyuan 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. labels Feb 15, 2026
@illicitonion

Copy link
Copy Markdown
Member

Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it.

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.

3 participants