Skip to content

Conversation

@SabitaShrestha325
Copy link

@SabitaShrestha325 SabitaShrestha325 commented Feb 26, 2025

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 COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • 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.

@SabitaShrestha325 SabitaShrestha325 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 26, 2025
@suziebrown suziebrown added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 6, 2025
Copy link

@suziebrown suziebrown left a comment

Choose a reason for hiding this comment

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

Looking good 👍
I've just left a few small suggestions where things could be improved

// This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution.

let initials = ``;
let initials = firstName.charAt(0) + middleName.charAt(0) + lastName.charAt(0);

Choose a reason for hiding this comment

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

Great 👍
You can also use e.g. firstName[0] instead of firstName.charAt(0) - either option is fine.

const twentyFourHourClockTime = "08:53";
console.log(twelveHourClockTime);
console.log(twentyFourHourClockTime);
//it says syntax error because variable should start with letter or underscore.

Choose a reason for hiding this comment

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

Well spotted. Can you see any other mistake in the code?


// a) How many function calls are there in this file? Write down all the lines where a function call is made
//ans- There are 5 function calls:
//carPrice = Number(carPrice.replaceAll(",", ""));

Choose a reason for hiding this comment

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

You're right, but can you make the explanation clearer? Which lines are the function calls on and which are the functions being called?

// remainingSEcond = movieLength % 60

// e) What do you think the variable result represents? Can you think of a better name for this variable?
// anns: Better name for this variable will be "formattedMovieDuration" because it is more descriptive, clearly indicating that the value is a formatted string representing the movie's duration.

Choose a reason for hiding this comment

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

Good choice of name 👍

const totalHours = (totalMinutes - remainingMinutes) / 60;
const timeString = `${totalHours}:${remainingMinutes}:${remainingSeconds}`;
console.log(timeString);
// It does work with another value as i change the movie length, it does work.

Choose a reason for hiding this comment

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

Did you try with any other values? Can you think of any edge cases where the formatting might not work correctly?

// When the function is called with such a card,
// Then it should throw an error indicating "Invalid card rank."
const invalidCards =getCardValue("Invalid")
assertEquals(invalidCards, "Invalid card" )

Choose a reason for hiding this comment

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

I think some of the test cases are not passing yet. See if you can change the code to work in all scenarios

Choose a reason for hiding this comment

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

I can see you got all the cases working in the later exercise - well done

expect(getAngleType(180)).toEqual("Straight angle");
});

test("should identify reflex angle (90°)", () => {

Choose a reason for hiding this comment

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

Remember to check that each test name accurately describes the test case. It's easy to make mistakes when writing several similar tests!


// Case 4: Handle Ace (A):
test("should return 11 for ace card",()=>{
const cardA =getCardValue("A");

Choose a reason for hiding this comment

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

Make sure the input used in the test is in the same format as in the instructions

// And a character char that does not exist within the case-sensitive str,
// When the function is called with these inputs,
// Then it should return 0, indicating that no occurrences of the char were found in the case-sensitive str.
test("should return 0 for the case-sensitive str ",()=>{

Choose a reason for hiding this comment

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

Can you improve the name of this test at all? Under what circumstances should 0 be returned?

test("should return '4th' for 4", () => {
expect(getOrdinalNumber(4)).toEqual("4th");
});

Choose a reason for hiding this comment

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

Can you think of any other cases that should be tested?

@suziebrown suziebrown added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Mar 6, 2025
@SabitaShrestha325
Copy link
Author

Looking good 👍 I've just left a few small suggestions where things could be improved

Thank you for your review. I really appreciate and I will improved area as you mention me.

@SabitaShrestha325
Copy link
Author

Looking good 👍 I've just left a few small suggestions where things could be improved

I have made changes as you mentioned. Thank you.

@SabitaShrestha325 SabitaShrestha325 added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants