Skip to content

Conversation

@anosidium
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 completed all the exercises.

Questions

I understand why TypeScript exists. JavaScript should have been a statically typed language.

@anosidium anosidium added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 22, 2025
@anosidium anosidium changed the title London | 25-ITP-September | Ammad Ur Rehman | Sprint 1 | 03 Complete Sprint 2 Coursework London | 25-ITP-September | Ammad Ur Rehman | Sprint 2 | 03 Complete Sprint 2 Coursework Oct 22, 2025
Comment on lines +27 to +32
function percentaged(decimalNumber) {
const constant = 0.5;
const percentage = `${constant * 100}%`;

return percentage;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The function would always return "50%" regardless of the parameter value.


function product(a, b) {
const result = a * b;
console.log(result)
Copy link
Contributor

Choose a reason for hiding this comment

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

It is a best practice to remove all debugging code before submitting our code for review.

function calculateBMI(weight, height) {
// return the BMI of someone based off their weight and height
const result = weight / Math.pow(height, 2);
return result.toFixed(1);
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 the function to return? A number or a string?
Does your function return the type of value you expect?

Comment on lines +20 to +22
.split(" ")
.map(word => word.toUpperCase())
.reduce((accumulator, currentValue) => accumulator + "_" + currentValue);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use the built-in String function to replace characters?

// c) What is the return value of pad is called for the first time?
// =============> write your answer here

// 00
Copy link
Contributor

Choose a reason for hiding this comment

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

A common convention for indicating that a value is a string is to enclose it in double quotes. For example, "00".

if (hours > 12) {
return `${hours - 12}:00 pm`;
let hours = Number(time.slice(0, 2));
const minutes = time.slice(3, 5);
Copy link
Contributor

Choose a reason for hiding this comment

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

We can also extract the last two characters as time.slice(-2).

@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 Oct 25, 2025
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