London | 26-ITP-JAN | Shuheda Begum | Sprint 1 | Structuring and Testing Data#937
Open
codebyshay wants to merge 16 commits intoCodeYourFuture:mainfrom
Open
London | 26-ITP-JAN | Shuheda Begum | Sprint 1 | Structuring and Testing Data#937codebyshay wants to merge 16 commits intoCodeYourFuture:mainfrom
codebyshay wants to merge 16 commits intoCodeYourFuture:mainfrom
Conversation
Initials fixed
const dir and const ext
What does num represent with explanation
Adding // to make a comment or add instructions for human consumption.
let allows variable age, const does not.
Swapped the position of const from under the console to on top of the console to allow javascript to read it in order.
Add String to the cardNumber so javascript recognises it as a string and not just numbers, making it possible to slice.
SyntaxError fixed..twelve instead of 12 and twentyFour instead of 24
Answered all questions and added , to the function.
Answered questions
Explain each step one by one.
Answered questions and tried alert and prompt on chrome dev tool.
Completed dev tool exercise on chrome.
Theoreoluwa
reviewed
Feb 18, 2026
Comment on lines
+6
to
+8
|
|
||
| // The code above will output 34, because we are reassigning the value of age to be the current value of age plus 1. So, 33 + 1 = 34. | ||
|
|
There was a problem hiding this comment.
Do you think the explanation provided here hit the major reason why the error was occurring even if you did the right thing in your code?
Theoreoluwa
reviewed
Feb 18, 2026
| @@ -1,9 +1,12 @@ | |||
| const cardNumber = 4533787178994213; | |||
| const last4Digits = cardNumber.slice(-4); | |||
| const last4Digits = String(cardNumber).slice(-4); | |||
There was a problem hiding this comment.
Now, you did the right thing by explaining your reasoning to debug the error. I would suggest applying a much cleaner way to convert the variable into a string without redeclaring it. You can look into that method using MDN docs.
Theoreoluwa
reviewed
Feb 18, 2026
|
|
||
| // f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer | ||
|
|
||
| // This code will work for all positive integer values of movieLength. It will correctly calculate the hours, minutes and seconds for any length of movie. However, if movieLength is negative or not an integer, the code may not work as intended. For example, if movieLength is -100, the calculations will not make sense in the context of a movie length. If movieLength is a decimal, it may also cause issues with the calculations. No newline at end of file |
There was a problem hiding this comment.
Have you considered if there could be some time formatting issues with smaller integer numbers?
Theoreoluwa
reviewed
Feb 18, 2026
Theoreoluwa
left a comment
There was a problem hiding this comment.
Great job so far; kindly look into the comments to make it better. Well done.
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
Changelist
Did exercise 1.
Questions
N/A