Skip to content

London | 26-ITP-May | Damilola Odumosu | Sprint 1 | Coursework#1364

Open
d-odumosu wants to merge 13 commits into
CodeYourFuture:mainfrom
d-odumosu:coursework/sprint-1
Open

London | 26-ITP-May | Damilola Odumosu | Sprint 1 | Coursework#1364
d-odumosu wants to merge 13 commits into
CodeYourFuture:mainfrom
d-odumosu:coursework/sprint-1

Conversation

@d-odumosu

@d-odumosu d-odumosu commented Jun 19, 2026

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 have completed the coursework requirements

@d-odumosu d-odumosu added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 19, 2026
Comment thread Sprint-1/1-key-exercises/1-count.js Outdated
Comment thread Sprint-1/1-key-exercises/3-paths.js Outdated
Comment on lines +21 to +24
const dir = filePath.slice(1 , 44);
console.log(dir)
const ext = filePath.slice(lastSlashIndex + 5 );
console.log(ext)

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.

Could you explore an approach that could work for any valid file path? For examples,
/tmp/interpret/file.json and /Users/mitch/cyf/Module-JS1/mycode.js.

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.

i have implemented this using indexof and slice

Comment on lines +1 to +2
const _12HourClockTime = "8:53pm";
const $24hourClockTime = "20:53";

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.

Identifiers that begin with _ or $ are valid variable, function, class, and property names. However, they are usually used by convention to signal special meaning.

Could you explore names that start with alphabets instead? Feel free to ask AI for suggestion.

// line 12 console,log()

// b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem?
//A syntaxError is occurring on line 5, we are missing a "," and a closing ")"

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.

We can more precisely describe "A comma is missing between "," and "" in the function call" as:
A comma is missing between the ___________s.

What is the programming term that belongs in the blank?

Note: The original code does not have a missing closing ")".

Comment on lines -24 to +31

//runTime

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.

runTime reads like "runtime", which has a different meaning in IT. Could you suggest a different (and more descriptive) name?

@cjyuan

cjyuan commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Regarding your PR description, could you update the checkboxes to make them look like

  • My changes meet the requirements of the task

instead of like

  • [ x ] My changes meet the requirements of the task

Relevant resource: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/about-tasklists

@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 Jun 23, 2026
Comment on lines +20 to +29
const firstSlash = filePath.indexOf("/");
const period = filePath.indexOf(".");
const secondSlash = filePath.indexOf("/", firstSlash + 1);
const thirdSlash = filePath.indexOf("/", secondSlash + 1);
const fourthSlash = filePath.indexOf("/", thirdSlash + 1);
const fifthSlash = filePath.indexOf("/", fourthSlash + 1);
const sixthSlash = filePath.indexOf("/", fifthSlash + 1);
const seventhSlash = filePath.indexOf("/", sixthSlash + 1);
const eighthSlash = filePath.indexOf("/", seventhSlash + 1);

@cjyuan cjyuan Jul 9, 2026

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.

Could you revise your code so that it works for any valid file path? For examples,
"/Users/folder.abc/data.json"
and
"/path1/path2/path3/file.tar.gz"

Note:

  • You could use the method used on line 13 to locate the last (right most) instance of a character in a string.
  • A file path always begin with a '/'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants