Skip to content

London | 26-ITP-Sept | Mars Adesina | Sprint 3 | Javascript Fundamentals - #1620

Open
marscancode wants to merge 7 commits into
CodeYourFuture:mainfrom
marscancode:coursework/sprint-3
Open

marscancode wants to merge 7 commits into
CodeYourFuture:mainfrom
marscancode:coursework/sprint-3

Conversation

@marscancode

Copy link
Copy Markdown

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

Task code

CYF-1053

Changelist

Completed all 5 sections of the sprint-3 coursework.

@netlify

netlify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit e0b2b1c
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6abce5008e7c6a00080791e6
😎 Deploy Preview https://deploy-preview-1620--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.

@github-actions

This comment has been minimized.

@marscancode marscancode added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Sep 28, 2026
@abdishakoor-dev abdishakoor-dev 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 Sep 29, 2026

@abdishakoor-dev abdishakoor-dev left a comment

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 explanations in 1-key-errors are clear, and every file runs with the right output. Prettier passes too.

Two things before I can mark this Complete:

  1. 2-mandatory-debug/1.js: the reason on line 11 needs another look. See my comment there.
  2. 2-cases.js: see my comment on line 19.

Add the Needs Review label again once you've pushed.

Comment thread Sprint-3/2-mandatory-debug/1.js Outdated

//console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
//console output: The sum of 10 and 32 is undefined
// sum is undefined because we haven't stored the operation we want it to perform correctly in a variable so its value is undefined.

@abdishakoor-dev abdishakoor-dev Sep 29, 2026 •

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 fixed code works. But is a variable really what was missing? Try return a + b; with no variable. Does it work?

Now look at the original line 5. What does return; do on its own? Does line 6 ever run?

Please update line 11 with the real reason why the original code wasn't working.

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.

That's the real reason now, and return a + b; works without a variable. Good.

// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase

// define function
function stringToUpperCase(str) {

@abdishakoor-dev abdishakoor-dev Sep 29, 2026 •

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 function works: it gives WELCOME_TO_CYF. Only the name needs to change.

The name stringToUpperCase tells the reader that your function only makes the letters capital. But your function makes the letters capital and replaces spaces with _. That is called upper snake case (line 4). So the name of your function should reflect what the function is doing.

Also, JavaScript already has a method called toUpperCase (it capitalises any string passed to it), which you use on line 21. If you use that name as inspiration, and take into account what upper snake case means, what would you call your function now? Please rename it, and the call on line 26.

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.

stringToUpperCaseSnake says both jobs now, so that's fine.

For next time: a name like toUpperSnakeCase would fit even better. It follows the same pattern as JavaScript's own toUpperCase: "to" plus what the string becomes. No change needed here.


function toPounds(pence) {
//Declare penceString variable
let penceString = pence;

@abdishakoor-dev abdishakoor-dev Sep 29, 2026 •

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.

Line 10 copies pence into a new variable. Unless penceString is some kind of new value, why not use pence directly? Do we really need to declare a new variable called penceString?

Also, none of the let variables in this file change after they are set. In 1-bmi.js you used const for that. Why not here too? Unless a variable value will change down the line, const is enough.

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.

Thanks Abdi! I've fixed the code and pushed the changes so hopefully all should be correct now.

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.

Good, const everywhere and no copy of the parameter. Thanks for doing the optional one too.

@abdishakoor-dev abdishakoor-dev 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 Sep 29, 2026
@marscancode marscancode added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Sep 30, 2026

@abdishakoor-dev abdishakoor-dev left a comment •

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.

Nice work on 2-mandatory-debug/1.js. Your new reason on line 11 is exactly right: return ends the function, so a + b never runs.

One small thing before I can mark this Complete. 2-mandatory-debug/1.js now fails Prettier. Line 16, return a + b;, has no indent, and line 11 has a space at the end. Right click in the file, choose Format Document, save and push. To have Prettier do this every time you save, follow the format on save steps here: https://github.com/CodeYourFuture/Module-JavaScript-Fundamentals/blob/main/practical_guide.md

Add the Needs Review label again once you've pushed.

@abdishakoor-dev abdishakoor-dev 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 30, 2026
@marscancode marscancode added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Sep 30, 2026

@abdishakoor-dev abdishakoor-dev left a comment

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.

Thanks Mars. 2-mandatory-debug/1.js passes Prettier now. Marking this Complete.

@abdishakoor-dev abdishakoor-dev added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Sep 30, 2026
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. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants