Skip to content

London | 26-ITP-January | Eugenie Ahangama | Sprint 2 | coursework/sprint 2#931

Open
Eugenie-A wants to merge 10 commits intoCodeYourFuture:mainfrom
Eugenie-A:coursework/sprint-2
Open

London | 26-ITP-January | Eugenie Ahangama | Sprint 2 | coursework/sprint 2#931
Eugenie-A wants to merge 10 commits intoCodeYourFuture:mainfrom
Eugenie-A:coursework/sprint-2

Conversation

@Eugenie-A
Copy link

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 worked through the Sprint 2 exercises by going through the starter code, identifying the main errors and making sure I understood why the logic wasn't working. I then wrote tests in the debug section to clearly show the issues before fixing anything. After that, I implemented the correct JavaScript behaviour so the function produced the right results. Finally, in the interpret task, I explained what the original code was doing, why it failed and how my fixes solved those problems.

MDN References I used:
String.prototype.slice()
Number() constructor
Template literals
console.assert()
String.prototype.split()
Array.prototype.map()
Remainder operator (%)
String.prototype.padStart()
String.prototype.substring()
String.prototype.replace()
String.prototype.trim()
String.prototype.toUpperCase()
Function parameters
Return

Questions

What's the best way to structure a debugging process?

@Eugenie-A Eugenie-A added 🏕 Priority Mandatory This work is expected 🦑 Size Large 4-8 hours 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Submit:PR Module-Structuring-And-Testing-Data The name of the module. labels Feb 4, 2026
function calculateBMI(weight, height) {
// return the BMI of someone based off their weight and height
} No newline at end of file
return (weight / (height * height)).toFixed(1); // toFixed(1) rounds to 1 decimal place.
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

@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 Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Structuring-And-Testing-Data The name of the module. 🏕 Priority Mandatory This work is expected Reviewed Volunteer to add when completing a review with trainee action still to take. 🦑 Size Large 4-8 hours 📅 Sprint 2 Assigned during Sprint 2 of this module Submit:PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants