Skip to content

London | 26-ITP-May | Russom Gebremeskel | Sprint 2 | Coursework/sprint 2#1458

Open
russom-g wants to merge 15 commits into
CodeYourFuture:mainfrom
russom-g:coursework/sprint-2
Open

London | 26-ITP-May | Russom Gebremeskel | Sprint 2 | Coursework/sprint 2#1458
russom-g wants to merge 15 commits into
CodeYourFuture:mainfrom
russom-g:coursework/sprint-2

Conversation

@russom-g

@russom-g russom-g commented Jul 4, 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 manage to predict, find, interpret and fix the errors in programs. I debugged each files and corrected the programs. I implemented functions based on requirements. I interpreted programs using documentations.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@russom-g russom-g added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 4, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 4, 2026
@russom-g russom-g added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 4, 2026
@Liam310 Liam310 added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 6, 2026
Comment on lines +38 to +39
// The return value of pad when it is called for the first time is 00. this is because the value of num is 0 and the pad function adds a 0 to the front of the string until the num characters has at least 2 characters.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To be precise, what exactly is the return value of pad? I think you know what it is, but 00 doesn't quite exactly describe it

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.

Hi Liam. Thanks for reviewing my code.
The exact return value is 0 . It ads a single 0 instead of two 0s.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not quite - what data type is the return value of pad?

Comment on lines +47 to +48

// The return value of pad when it is called for the last time is 01. This is because the pad function adds a 0 to the front of the string if the characters of the string are less than 2. No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same as above comment!

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.

Again it will be a single 0.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See above comment 🙂

Comment thread Sprint-2/1-key-errors/0.js
Comment thread Sprint-2/1-key-errors/1.js
//The sum of 10 and 32 is undefined

// The above error message is displayed when tested with node.
// The cause of the error message is the semicolon that is placed after the return statement.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Did this actually cause an error message to be displayed?

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.

It returns '' The sum of 10 and 32 is undefined". Initially I had assumed that this was happening because of the semicolon after return. Now I run the code again this time without the semicolon still get "undefined" message. I did some research online and it is actually not just because of the semicolon but because both the return statement and the expression "a+b" are not on the same line.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

That's correct, and the point I want to make is that

It returns '' The sum of 10 and 32 is undefined".

Highlights that there was no "error message" such as a SyntaxError or TypeError, but rather there was a bug in the code, i.e. the code would run but wouldn't perform the correct operations. A subtle difference but a useful one!

// 1) The above output (3) is displayed because the variable num is declared as a constant
// 2) .slice(-1) is used to get the last digit of num inside the function.
// 3) The function does not take any parameters so when it is called with an arguments it always returns the last digit of the constant num 103.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would this be different if the variable was declared with let?

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.

No. I realise that the error is actually not because it declared as const. num isn't defined as the function's parameter so the function can take arguments later on when it's called.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great! You should amend the explanation so it is correct 🙂

Comment thread Sprint-2/3-mandatory-implement/3-to-pounds.js
Comment thread Sprint-2/5-stretch-extend/format-time.js Outdated
@Liam310 Liam310 removed the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 6, 2026
@Liam310 Liam310 added the Reviewed Volunteer to add when completing a review with trainee action still to take. label Jul 6, 2026
russom added 2 commits July 7, 2026 22:31
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