London | 26-ITP-Jan | Zadri Abdule | Sprint 2 | Coursework#966
Open
Zadri415 wants to merge 15 commits intoCodeYourFuture:mainfrom
Open
London | 26-ITP-Jan | Zadri Abdule | Sprint 2 | Coursework#966Zadri415 wants to merge 15 commits intoCodeYourFuture:mainfrom
Zadri415 wants to merge 15 commits intoCodeYourFuture:mainfrom
Conversation
codeschris
reviewed
Feb 15, 2026
| // The "Unexpected number" | ||
| // Finally, correct the code to fix the problem | ||
|
|
||
| // The "Unexpected number" error arises when a number is improperly positioned or used within JvaScript code |
There was a problem hiding this comment.
Always double-check to avoid typos in the comments that could lead to confusion (small detail that means a lot)
codeschris
reviewed
Feb 15, 2026
| } | ||
|
|
||
| console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); | ||
| console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)} |
codeschris
reviewed
Feb 15, 2026
| console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); | ||
|
|
||
| // =============> write your explanation here | ||
| // The problem was the semicolon after return, which made the function stop before adding the numbers |
There was a problem hiding this comment.
Could you review the code you have written below as the solution and the previous code to understand why the previous function (before your solution) raised an error and update the explanation?
| const penceStringWithoutTrailingP = penceString.substring(0, penceString.length -1); | ||
| const pounds = paddedPenceNumberString.slice(0, -2); | ||
| const pence = paddedPenceNumberString.slice(-2); | ||
| return `£${pounds}.${pence}`; |
|
|
||
| // You should call this function a number of times to check it works for different inputs | ||
| function formatPenceToPounds(penceString){ | ||
| const penceStringWithoutTrailingP = penceString.substring(0, penceString.length -1); |
There was a problem hiding this comment.
Is this variable in use when the function is called (or at all)?
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Learners, PR Template
Self checklist
Completed all of the tasks for Sprint 2.