Skip to content

BARCELONA | CLASS-OCT2025-02 | JOSEPH AYITEY | SPRINT 2 | COURSEWORK/SPRINT2 - #3

Open
joseph-ayitey wants to merge 16 commits into
mainfrom
coursework/sprint-2
Open

BARCELONA | CLASS-OCT2025-02 | JOSEPH AYITEY | SPRINT 2 | COURSEWORK/SPRINT2#3
joseph-ayitey wants to merge 16 commits into
mainfrom
coursework/sprint-2

Conversation

@joseph-ayitey

@joseph-ayitey joseph-ayitey commented Dec 19, 2025

Copy link
Copy Markdown
Owner

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@mvcds mvcds left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There's a 🚫 on the PR

Comment on lines +26 to +29
function capitalize(str) {
let capitalizedStr = `${str[0].toUpperCase()}${str.slice(1)}`;
return capitalizedStr;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This funcion already had been declared above

Comment on lines +31 to +35
function capitalize(str) {
console.log(capitalize("hello")); // Output: "Hello"
let str = `${str[0].toUpperCase()}${str.slice(1)}`;
return str;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This funcion already had been declared above

And this declaration does not work 🚫

return str;
}

//You can reassign function parameters, but you cannot redeclare them with let or const in the same scope.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  1. What do you mean by "reassign"?
  2. And about "declare"?
  3. What do you understand for "scope"?

// SyntaxError: Unexpected number

// =============> explain this error message here
// The error occurs because function parameters should be variable names, not literal values.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What's your understanding of "variable" vs "literal values"?


// =============> write your explanation here
// The `return` statement is followed by a semicolon on the next line,
// so JavaScript automatically inserts a semicolon after `return`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Little observation here, javascript does not add a semicolon after return, you IDE (visual studio, copilot, etc) does this because it has been configured to do so because it makes some kinds of easy-to-miss errors to go away

Such configuration can be turned off, as not everyone if fan of having semicolumns as mandatory

// Explain why getLastDigit is not working properly - correct the problem

// The function did not accept any parameters, so it always used the constant `num` (103).
// By adding a parameter to the function, it can now accept different numbers

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I notice the name of the parameter in the funcion is the same as the contant, what makes it work?

`current output: ${currentOutput2}, target output: ${targetOutput2}`
);

const currentOutput3 = formatAs12HourClock("12:00");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thoughout this exercise, what made you choosee this inputs to test? From this line to the EOF (end of file)?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants