Skip to content

Cape Town | 25-ITP-MAY | Asanda Dunn | Sprint 3 | JavaScript Fundamentals - #1603

Open
asandagwala wants to merge 1 commit into
CodeYourFuture:mainfrom
asandagwala:sprint_3
Open

asandagwala wants to merge 1 commit into
CodeYourFuture:mainfrom
asandagwala:sprint_3

Conversation

@asandagwala

Copy link
Copy Markdown

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

Task code

CYF-1053

Changelist

  • Completed JavaScript error prediction and debugging exercises.

  • Identified and fixed syntax, scope, redeclaration, parameter, and return statement errors.

  • Implemented reusable functions for:

  • Calculating BMI

  • Converting strings to UPPER_SNAKE_CASE

  • Converting pence to pounds

  • Practised function parameters, return values, and function calls.

@netlify

netlify Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit 4f08500
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6ab82290b81e210008b0bbc4
😎 Deploy Preview https://deploy-preview-1603--cyf-onboarding-module.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
2 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 86 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@asandagwala asandagwala added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 26, 2026
Comment on lines +17 to +20
function capitalise(str) {
str = `${str[0].toUpperCase()}${str.slice(1)}`;
return str;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The alternatives of reassigning the function parameters are:

  • Use a separate const variable
  • Return the value of the expression directly

Suggestion: Use AI to explore the trade-off of these approaches.

Comment on lines 29 to +35
// b) What is the value assigned to num when pad is called for the first time?
// =============> write your answer here
// 1

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the expression `${pad(totalHours)}:${pad(remainingMinutes)}:${pad(remainingSeconds)}`, which pad() is called first?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

My understanding is that JavaScript evaluates the expressions from left to right so inn this instance totalHours is called first

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Your understand is correct. The next question is, what's the value of totalHours?

@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 Sep 29, 2026
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