-
-
Notifications
You must be signed in to change notification settings - Fork 546
London | 26-ITP-Sep| Abdennour Hachemi| Sprint 2 | Coursework #1547
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
AbdennourHachemi
wants to merge
26
commits into
CodeYourFuture:main
Choose a base branch
from
AbdennourHachemi: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
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
6278aca
adding a h2
AbdennourHachemi 1e2d9f3
Adding the answer to exercise1
AbdennourHachemi 05b468c
solving the exercise
AbdennourHachemi d1507f1
solving the exercise using slice method
AbdennourHachemi dc792ba
solving exercise 4-random
AbdennourHachemi cfceef2
solving exercise 0.js
AbdennourHachemi dc92e00
solving exercise 1.js
AbdennourHachemi 6f3c7bb
solving exercise 2.js
AbdennourHachemi da76479
solving exercise 3.js
AbdennourHachemi 8fc0ed8
solving exercise 4.js
AbdennourHachemi 51551e1
sovling exercise 1-percentage-change
AbdennourHachemi 98b99fe
update solution
AbdennourHachemi 7e1fd30
solving exercise 2-time-format
AbdennourHachemi e3bf82a
solving exercise 3-to-pounds
AbdennourHachemi c6f0fd0
solve chrom.md
AbdennourHachemi 0290b7c
solving objects exercise
AbdennourHachemi ed20ed5
Remove accidentally tracked education-blog/education-blog submodule
AbdennourHachemi 5329549
correcting exercise 2-time-format
AbdennourHachemi 1f6a0a3
Further correction exercise 2-time-format
AbdennourHachemi d386bfb
correcting exercise 1.js
AbdennourHachemi b1e0fc1
fixing issues in excersie 4-random
AbdennourHachemi 33458e1
correcting exercise 3-paths.js
AbdennourHachemi 21c5ff7
fixing .gitignore issue
AbdennourHachemi 3754064
correct comment on line 27 4-random.js exercise
AbdennourHachemi c4041a0
Correcting comment on line 27
AbdennourHachemi a727eb0
correction
AbdennourHachemi 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,2 @@ | ||
| 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? | ||
| /*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?*/ |
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,11 @@ | ||
| // trying to create an age variable and then reassign the value by 1 | ||
|
|
||
| const age = 33; | ||
| let age = 33; | ||
| age = age + 1; | ||
|
|
||
| /* | ||
| Answer : The Error is : TypeError: Assignment to constant variable. | ||
| Constants in JavaScript can't be reassigned to correct this we have to change the varible type from const => let. | ||
|
|
||
| */ | ||
| console.log(age) | ||
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,5 +1,10 @@ | ||
| // Currently trying to print the string "I was born in Bolton" but it isn't working... | ||
| // what's the error ? | ||
|
|
||
| console.log(`I was born in ${cityOfBirth}`); | ||
| //Answer : the error was that CitOfBirth vaiable was declared after the method cosole .log() | ||
| //The solution is to declare it before calling it. | ||
|
|
||
| const cityOfBirth = "Bolton"; | ||
|
|
||
| console.log(`I was born in ${cityOfBirth}`); | ||
|
|
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,21 @@ | ||
| const cardNumber = 4533787178994213; | ||
| const last4Digits = cardNumber.slice(-4); | ||
| const last4Digits = cardNumber.toString().slice(-4); | ||
|
|
||
| // 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 | ||
|
|
||
| /* | ||
| Prediction : The slice method is used with String data type. here we have cardNumber varible with type Number. | ||
| Running the code will give a TypeError : cardNumber.slice is not a function | ||
| The solution is to convert numbe to string, There are three posibility: | ||
| String(cardNumber) | ||
| cardNumber.toString() | ||
| `${cardNumber}` | ||
|
|
||
| */ | ||
|
|
||
| console.log(last4Digits); |
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,6 @@ | ||
| const 12HourClockTime = "8:53pm"; | ||
| const 24hourClockTime = "20:53"; | ||
| const HourClockTime12 = "8:53pm"; | ||
| const hourClockTime24 = "20:53"; | ||
|
|
||
| /* | ||
| the naming of of the varibles is not correct varible should not start with a number | ||
| */ |
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.
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.
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.
The fix is right and the file runs. This section also asks you to interpret the error and explain why it happened, and there is nothing written down here. You did that well in
2.js,3.jsand4.js, so the same again. What did node print before you changedconsttolet?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.
Good, the message and the reason are both written down now.