Skip to content

Conversation

@Geraldine-Edwards
Copy link

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

This PR contains the javascript exercises in the cat, ls and wc directories of the implement-shell-tools directory

Questions

I'd be interested to see what ways I could refactor the code in the files and also match the exact wc output in my file, thanks.

@Geraldine-Edwards Geraldine-Edwards added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 22, 2025
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

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

Good work on these tasks, sorry for the late review

Good use of comments to explain your code

I've left comments in some areas where you could improve your code

const sortedEntries = sortEntries(filteredEntries);

// print entries for -1 flag (one per line)
printEntries(sortedEntries);

Choose a reason for hiding this comment

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

How does your code differ if the user does not give the -1flag?

Copy link
Author

Choose a reason for hiding this comment

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

Ah thanks for this @LonMcGregor! I hadn't finished formatting the output for not using the -1 flag, oops! Fixed it now :)

}
if (files.length > 1) {
// print the totals as wc does
printWcOutput(totalLines, totalWords, totalBytes, "total", options, noFlags);

Choose a reason for hiding this comment

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

What should happen if I give only a single option, e.g. node wc.js sample-files/1.txt -c? Does this print correctly?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks again @LonMcGregor :) I have spotted my error in the program options configuration and changed the remainder of the file as needed to the long flag names.

@LonMcGregor LonMcGregor 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 Dec 17, 2025
@Geraldine-Edwards Geraldine-Edwards 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 Jan 2, 2026
@LonMcGregor
Copy link

Good work, this looks finished now

@LonMcGregor LonMcGregor 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 Jan 5, 2026
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