generated from CodeYourFuture/Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 326
London | 26-ITP-Jan | Zadri Abdule | Sprint 1 | Coursework #964
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
Zadri415
wants to merge
25
commits into
CodeYourFuture:main
Choose a base branch
from
Zadri415:coursework/sprint-1
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
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
7995c8d
Explain assignment in count increment example
Zadri415 5213e77
Add intitials variables charAt method
Zadri415 c77a3cf
Add dir and ext variables
Zadri415 ba118b5
Add explanatory comments to random number generator code
Zadri415 d5dfe95
Comment out instruction lines so they are not executed
Zadri415 5c9289a
Change age variable from const to let to allow reassignment
Zadri415 8f743b2
Add comment explaining instialization error
Zadri415 095d155
Add predict that the code will fail because .slice() is not valid on …
Zadri415 e054a32
Predict that the code will fail because .slice() is not valid on a nu…
Zadri415 6ea69f1
Fix: renamed variable starting with a number to follow JS naming rules
Zadri415 40825f8
Added MDN-based explanation,and documented variable declarations
Zadri415 5f00dde
Completed answers for 2-time-format.js
Zadri415 265ee10
Added line-by-line explanations for 3-to-pounds.js
Zadri415 0463851
Merge branch 'main' into coursework/sprint-1
Zadri415 0d51c23
Update 1.js
Zadri415 2f6b3d4
Merge branch 'CodeYourFuture:main' into coursework/sprint-1
Zadri415 813fe73
Update 1-count.js
Zadri415 0767a42
Update 3-paths.js
Zadri415 401518d
Update 3-paths.js
Zadri415 c8eacf0
Update 1.js
Zadri415 5df9b40
Update 1.js
Zadri415 94e1886
Update 1.js
Zadri415 611b033
Update 1.js
Zadri415 35a1a97
Update 1.js
Zadri415 a4dbb5a
Update 3-paths.js
Zadri415 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| This is just an instruction for the first activity - but it is just for human consumption | ||
| We don't want the computer to run these 2 lines - how can we solve this problem? | ||
| We don't want the computer to run these 2 lines - how can we solve this problem? | ||
| // Using // to make them comments should resolve the problem. The // tells JavaScript to skip that line completely |
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revisit this file. Solution was not provided. Remove unnecessary code
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for pointing that out. I've made the changes that were suggested. |
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,4 +1,12 @@ | ||
| // trying to create an age variable and then reassign the value by 1 | ||
|
|
||
| const age = 33; | ||
| age = age + 1; | ||
|
|
||
|
|
||
| let age = 33; | ||
|
|
||
| age++; // Increases age by 1 | ||
|
|
||
| console.log(age); // Output: 34 | ||
|
|
||
|
|
||
|
|
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,9 +1,13 @@ | ||
| const cardNumber = 4533787178994213; | ||
| const last4Digits = cardNumber.slice(-4); | ||
| const last4Digits = cardNumber.toString().slice(-4); | ||
| console.log(last4Digits); | ||
|
|
||
| // The last4Digits variable should store the last 4 digits of cardNumber | ||
| // However, the code isn't working | ||
| // Before running the code, make and explain a prediction about why the code won't work | ||
| // Then run the code and see what error it gives. | ||
| // Consider: Why does it give this error? Is this what I predicted? If not, what's different? | ||
| // Then try updating the expression last4Digits is assigned to, in order to get the correct value | ||
|
|
||
| // I predict that the code will fail because .slice() is not valid on a number - The variable is a number, but .slice() only works on strings and arrays. | ||
| // The error that I got is similar to what I had predicted. |
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,2 +1,13 @@ | ||
| const 12HourClockTime = "20:53"; | ||
| const 24hourClockTime = "08:53"; | ||
| // This line of code attempts to declare a constant variable named 12HourClockTime, but it results in a syntax error | ||
| const 24hourClockTime = "08:53"; | ||
|
|
||
| // While testing the code, the following error appeared in console: | ||
| // SyntaxError: Invalid or unexpected token | ||
|
|
||
| // Why did this error occur? according to the MDN Web Docs: https://developer.mozilla.org/en-US/docs , a "SyntaxError: Invalid or unexpected token" occurs when JavaScript encounters code that doesn't follow proper syntax rules | ||
| // In this case, the error happens because JavaScript does not allow variable names to start with numbers. Variable names (also called identifiers) must begin with a letter, underscore (_), or dollar sign ($) | ||
|
|
||
| // How to fix the error: | ||
| const hour12ClockTime = "20:53"; | ||
| // These version follow JavaScript naming rules and will execute without errors |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to recheck the requirements and see if your code solves the problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has not been resolved. doa console.log for the dir and ext variables. Does your code run without an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zadri415 you haven't resolved this. Look into the lastDotIndex you have on the ext variable. Also confirm if dir was console logged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the file as you suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zadri415 you are using lastDotIndex that was never defined