-
-
Notifications
You must be signed in to change notification settings - Fork 391
West Midlands | May 2026 | Muhammad-Burhan Mustafa | Sprint 2 | Module-Structuring-and-Testing-Data #1443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
burhan-mustafa
wants to merge
18
commits into
CodeYourFuture:main
Choose a base branch
from
burhan-mustafa:coursework/sprint-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
West Midlands | May 2026 | Muhammad-Burhan Mustafa | Sprint 2 | Module-Structuring-and-Testing-Data #1443
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ce7f3df
prep clock
burhan-mustafa 509aee5
string for prep
burhan-mustafa 1f4dc42
Sprint 2 Task 2 completed
burhan-mustafa 514c086
Sprint 2 Task 0 completed
burhan-mustafa 2905703
Sprint 2 Task 2 completed
burhan-mustafa e52b096
Task 0 Folder 2 Complete
burhan-mustafa 329448e
sprint 2 task 2 exercise 1 completed
burhan-mustafa 25fffb6
sprint two task 2 exercise 2 complete
burhan-mustafa fa080a4
Sprint 2 Task 3 Exercise 1 Completed
burhan-mustafa 6a4c5ad
Sprint 2 Task 3 Exercise 2 Completed
burhan-mustafa 5dc9a63
Sprint 2 Task 3 Exercise 3
burhan-mustafa f9f9cdd
Sprint 2 Task 4 Exercise time-format completed
burhan-mustafa fa6a305
removed prep folder for pull request
burhan-mustafa 77770dd
Simplified Function
burhan-mustafa 360b7a7
bmi is now rounded to one decimal place
burhan-mustafa 3bc7d4f
changed function name to lower camel case
burhan-mustafa ddfd57a
added another reason as to whats wrong with the code
burhan-mustafa dd44041
found the other issue in this function
burhan-mustafa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,26 @@ | ||
| // Predict and explain first... | ||
| // =============> write your prediction here | ||
| // =============> write your prediction here | ||
| // An error will be thrown because str has already been declared as the function's parameter. | ||
| // The function parameter and the let variable are both declared in the same function scope. | ||
|
|
||
| // call the function capitalise with a string input | ||
| // interpret the error message and figure out why an error is occurring | ||
| // Call the function capitalise with a string input. | ||
| // Interpret the error message and figure out why an error is occurring. | ||
|
|
||
| function capitalise(str) { | ||
| let str = `${str[0].toUpperCase()}${str.slice(1)}`; | ||
| return str; | ||
| } | ||
|
|
||
| // =============> write your explanation here | ||
| // The error occurs because str is already declared as the function's parameter, so it cannot be | ||
| // declared again using let inside the same scope. By changing the new variable's name to | ||
| // capitalisedStr, there is no longer a naming conflict and the code runs without any errors. | ||
|
|
||
| // =============> write your new code here | ||
|
|
||
| function capitalise(str) { | ||
| let capitalisedStr = `${str[0].toUpperCase()}${str.slice(1)}`; | ||
| return capitalisedStr; | ||
| } | ||
|
|
||
| console.log(capitalise("mmm")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,25 @@ | ||
|
|
||
| // Predict and explain first BEFORE you run any code... | ||
|
|
||
| // this function should square any number but instead we're going to get an error | ||
|
|
||
| // =============> write your prediction of the error here | ||
| // =============> write your prediction of the error here: | ||
| // we have used a number instead of naming the parameter so we should get a syntax error | ||
|
|
||
| function square(3) { | ||
| return num * num; | ||
| return num * num; | ||
| } | ||
|
|
||
| // =============> write the error message here | ||
| // SyntaxError: Unexpected number | ||
|
|
||
| // =============> explain this error message here | ||
| // JavaScript read the number 3 as a number rather than the name of the parameter. | ||
| // Parameters must have valid names | ||
|
|
||
| // Finally, correct the code to fix the problem | ||
|
|
||
| // =============> write your new code here | ||
|
|
||
|
|
||
| function square(num) { | ||
| return num * num; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.