Skip to content

Glasgow | ITP May -25 | Pandi Simatupang | Module-Structuring-and-Testing-Data | coursework/sprint-2 #650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

PandiSimatupang
Copy link

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_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Answers and comments to Sprint-2.

Questions

Null

@PandiSimatupang PandiSimatupang added the Needs Review Participant to add when requesting review label Jul 10, 2025
@YoanHlebarov YoanHlebarov added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 12, 2025
Copy link

@YoanHlebarov YoanHlebarov left a comment

Choose a reason for hiding this comment

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

Nice, there is a lot of excellent code here, and you can understand how a code will run before it has run.

@@ -1,13 +1,21 @@
// Predict and explain first...
// =============> write your prediction here
//the function will turn the first given string into Uppercase.

Choose a reason for hiding this comment

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

Suggested change
//the function will turn the first given string into Uppercase.
//the function will turn the first character of a given string into Uppercase.

Copy link
Author

Choose a reason for hiding this comment

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

Yes Sir!.. Noted. I should use "the first character" instead of "the first String"

Choose a reason for hiding this comment

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

For information/reference, when declaring a function we call these parameters, when we call the function we call them arguments. It is a subtle distinction but is important to remember especially when communicating with other developers.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you. Noted, I often confuse those both terms.


// =============> write your explanation here
//function will execute line the code and escape from the function block whenever it "sees" return.. it will return with any expression put on it
// in this function a+b which is expected as the result is placed after return line because return has ";" so i wont bother look the next line.

Choose a reason for hiding this comment

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

It is important to note that ; [semicolon] is not needed in this case for the function to return when it reaches the return statement. New line is also a valid way to end the line, thus the function will not execute a + b even if we were missing a ;.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, I used to think that a semicolon marked is the end of a statement, but now I know that a newline (\n) can also signify the end.

Choose a reason for hiding this comment

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

Can you wrap your code into a function that is then called with the argument "hello world I am sleepy"?

@YoanHlebarov YoanHlebarov added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jul 12, 2025
@PandiSimatupang PandiSimatupang added Needs Review Participant to add when requesting review and removed Reviewed Volunteer to add when completing a review labels Jul 16, 2025
@kodnificent kodnificent requested a review from YoanHlebarov July 18, 2025 12:58
@YoanHlebarov
Copy link

@PandiSimatupang The requirements for the Sprint-2/3-mandatory-implement/2-cases.js are not yet met. Make sure you create a function that can be used to manipulate a string that we pass to it.

Creating functions can help us reuse code we may find useful often. This has two benefits - 1st it allows us to clearly identify what happens if we have a good function name (eg stringToUpperCase()), 2nd if we ever need to modify the behaviour of this code, we only need to do it once - in the function, if you used the same code in many places you will have to modify it in many cases. We call this Technical Debt and this can become a serious issue that can have a real world implications to a business.

@YoanHlebarov YoanHlebarov added 👀 Review Requirements Changes requested to meet requirements 👀 Review Git Changes requested to do with Git and removed 👀 Review Requirements Changes requested to meet requirements 👀 Review Git Changes requested to do with Git labels Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 Review Requirements Changes requested to meet requirements Needs Review Participant to add when requesting review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants