Sheffield | 26-ITP-Jan | Mahmoud Shaabo | Sprint 2 | Structuring and Testing Data#1048
Sheffield | 26-ITP-Jan | Mahmoud Shaabo | Sprint 2 | Structuring and Testing Data#1048mahmoudshaabo1984 wants to merge 2 commits intoCodeYourFuture:mainfrom
Conversation
|
Hi team, 👋 Just a quick note to say that I have successfully completed all the mandatory tasks for Sprint 2. This week was incredibly helpful and enjoyable! I really liked the transition from debugging and fixing scope/syntax errors to actually implementing my own functions from scratch (like the BMI calculator and String manipulation). I made sure to document my code clearly, and I even added a few extra test cases of my own to ensure everything works perfectly under different conditions. Looking forward to your feedback and any suggestions for improvement. Thank you for your time and support! |
cjyuan
left a comment
There was a problem hiding this comment.
Code looks good.
I just have some comments and a question (see the inline comments)
Sprint-2/2-mandatory-debug/2.js
Outdated
| const num = 103; | ||
| // We don't need this global variable, so I commented it out: | ||
| // const num = 103; |
There was a problem hiding this comment.
Note: Deleting the global num is optional. Within the function block, num is resolved to the parameter num.
If you are interested in the topic, you can looking up these two concepts, identifier scope and identifier resolution, in the context of JavaScript programming. ChatGPT can give a good explanation.
| // return the BMI of someone based off their weight and height | ||
| } No newline at end of file | ||
| // 3. Return the result to 1 decimal place (إرجاع النتيجة بخانة عشرية واحدة) | ||
| return bmi.toFixed(1); |
There was a problem hiding this comment.
What type of value do you expect your function to return? A number or a string?
Does your function return the type of value you expect?
Different types of values may appear identical in the console output, but they are represented and treated differently in the program. For example,
console.log(123); // Output 123
console.log("123"); // Output 123
// Treated differently in the program
let sum1 = 123 + 100; // Evaluate to 223 -- a number
let sum 2 = "123" + 100; // Evaluate to "123100" -- a string.|
There were four self-check items in the PR template. In your PR description. There are only two. It is missing the following two items:
|
|
Hi CJ, thank you so much for the feedback and the clear explanations!
I have pushed the updates. Thank you again for your time and support! |
|
All changes look good. Well done! |
|
You should also add a "Needs review" label too when the PR is ready to be re-reviewed. I have marked this PR as "Complete". You can practice that in future PRs. :) |
Summary of work:
1-key-errorsand2-mandatory-debug.toUpperSnakeCase, andtoPoundsfunctions in3-mandatory-implement.4-mandatory-interpret.