-
-
Notifications
You must be signed in to change notification settings - Fork 382
Birmingham | 26-ITP-May | Tobias Amaechina | Sprint 1 | coursework #1369
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
Tobias-Amaechina
wants to merge
69
commits into
CodeYourFuture:main
Choose a base branch
from
Tobias-Amaechina:coursework
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
69 commits
Select commit
Hold shift + click to select a range
6626e33
add a comment to answer the question for sprint1
Tobias-Amaechina 268fe9a
using Template literal concept
Tobias-Amaechina a55b982
adding the quotation inside the backtick
Tobias-Amaechina 466a1ad
Using slice function to add arrays of string from first to the last s…
Tobias-Amaechina 90d852d
using lastIndesOf to locate last dot in arrays and assign it to lasdo…
Tobias-Amaechina ac380be
using slice method to add the extention of filename to the ext variable
Tobias-Amaechina be73fdd
using console method to log the details of dir and ext
Tobias-Amaechina ad02c56
breaking done what Math.random method is doing
Tobias-Amaechina fef3716
explaing what the (maximum -minimum +1 ) is doing with respect to the…
Tobias-Amaechina 0589943
explain what step 3 is doing with respect to Math.random()*(maximum-…
Tobias-Amaechina df3dd3b
Explains what step 4 math.floor (..) was doing
Tobias-Amaechina ae416a6
Explained what the entire expression on the right hand side was doing
Tobias-Amaechina 5267ace
step 5 explains what num stands for
Tobias-Amaechina 599cfbd
used multiple comment syntax to coment out the strings
Tobias-Amaechina 59a1f60
declaring a variable with Const key word doesn't allow reassigning s…
Tobias-Amaechina 1f1249d
the Varible was being access from the TDZ
Tobias-Amaechina 9dad574
the varible has been hoisted and initialled before accessing
Tobias-Amaechina 94df850
commenting out the first code to avoid SyntaxError
Tobias-Amaechina 26c75aa
I predicted that it wouldn't work as slice method is used on a numbe…
Tobias-Amaechina 7a6e15e
I printed the type of data type variable cardNumber is on the console…
Tobias-Amaechina e8a084e
commenting out the console.log(typeof cardNumber) before running the…
Tobias-Amaechina 536afc3
fixing the error my converting the number to string by putting doubl…
Tobias-Amaechina aec02fc
Identifier cannot start with a number,must start with a leter , _ or …
Tobias-Amaechina 224b857
the second varible was updated to start with underscore
Tobias-Amaechina fab2124
added the missing comma to correct the error
Tobias-Amaechina 0183466
answered question on Variable reasignment lines
Tobias-Amaechina 69966b3
answered queation about variable declration
Tobias-Amaechina 9a0c788
Answerd the question e about what the expression is doing
Tobias-Amaechina cb291d0
Answered question on how many variable delaration are in the file
Tobias-Amaechina 0eada55
Answered question on how many function calls are in the program
Tobias-Amaechina 5d2e5f9
Answered question on modulo Operation
Tobias-Amaechina 9a422af
Answered question on what line 4 is doing
Tobias-Amaechina 0d1fd04
Answered question on what the varible result represents and the bet…
Tobias-Amaechina b1a87d4
Answered question about if the code will work for all values
Tobias-Amaechina e6184ac
Describe the purpose and rational of step 2
Tobias-Amaechina 9b3dbab
answered the purpose and rationale of line 8
Tobias-Amaechina ac91e9c
explains the .padStart method in context
Tobias-Amaechina cdf22c6
explained the step 9 and it's rationale
Tobias-Amaechina 564b749
answered question and rationale of line 14 code
Tobias-Amaechina bb30402
explained the purpose of line 18 and it's rational
Tobias-Amaechina 771b9ec
Answered question about invoking Alert for chrome.md file
Tobias-Amaechina 56ee0b7
Answered question on the effect of prompt function in chrome.md file
Tobias-Amaechina 68c6a1f
Answered question about console.log on object.md file
Tobias-Amaechina 5720fea
updated the right ouput for console.log
Tobias-Amaechina 5a6e439
answered question of the output of console in the consoledevtool
Tobias-Amaechina 345ae8e
Answered question what I got when typed typeof console in Devtool c…
Tobias-Amaechina 9bd9215
Answered question about what console stores in Object.md file
Tobias-Amaechina 9460b09
answered the question about console.log and console.assert in object.…
Tobias-Amaechina 43a607c
I predicted and explain what will happen in the code when run
Tobias-Amaechina 4f0bc34
wrote what my prediction will look like
Tobias-Amaechina 5734386
call the function capitalise with a string 'tobias'
Tobias-Amaechina aa18722
interpreted the error and gave my explanation of the reason the erro…
Tobias-Amaechina a1ca363
added two ways the error can be fixed
Tobias-Amaechina 67b7b3e
interpreted the error generated and suggested two ways to fix the e…
Tobias-Amaechina 90a79fc
mistakenly deleted the original function , and now get it restored
Tobias-Amaechina 3465118
wrote a new code and comment out the original code
Tobias-Amaechina 82db135
console.log the function by passing tobias as arguement and see it o…
Tobias-Amaechina 90414e0
predicted and explained what will happen when the code is run
Tobias-Amaechina da1decc
Answered question about why an error will occur when the program is …
Tobias-Amaechina 9b41b32
tried playing compute and pasted what happened as SyntaxError: Ident…
Tobias-Amaechina bbc856e
The double qoute was removed to make the value for cardNumber as Num…
Tobias-Amaechina e969a10
using '.toString()' method to cast the data type number to string an…
Tobias-Amaechina be7f385
the '.slice()' method was then used to extract the the last 4 digit …
Tobias-Amaechina 01dd4fd
firstly explained what the naming convention I used earlier denote i…
Tobias-Amaechina 264a822
explain best practices used in naming variable in JavaScript
Tobias-Amaechina 3503a51
applied the naming convention to the first variable
Tobias-Amaechina 25a5ac8
applied the naming convention to the second variable
Tobias-Amaechina be4e495
Added more context and specically refer to the terms in the blank wi…
Tobias-Amaechina 9beb850
remove Sprint-2 files
Tobias-Amaechina 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,5 @@ | ||
| // trying to create an age variable and then reassign the value by 1 | ||
|
|
||
| const age = 33; | ||
| let age = 33; | ||
| age = age + 1; | ||
| 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,12 @@ | ||
| // 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}`); | ||
|
|
||
| /*console.log(`I was born in ${cityOfBirth}`); | ||
| const cityOfBirth = "Bolton";*/ | ||
| /* The error is that the variable `cityOfBirth` is being used before it is declared and assigned a value. In JavaScript, variables declared with `const` (or `let`) are not hoisted in the same way as `var`, so you cannot access them before their declaration. To fix this, you should declare and assign the variable before using it in the `console.log` statement:*/ | ||
| //The variable were being accessed from the Temporal Dead Zone (TDZ) before it was declared and assigned a value. In JavaScript, variables declared with `const` (or `let`) are not hoisted in the same way as `var`, so you cannot access them before their declaration. To fix this, you should declare and assign the variable before using it in the `console.log` statement: | ||
|
|
||
| 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,18 @@ | ||
| const cardNumber = 4533787178994213; | ||
| const last4Digits = cardNumber.slice(-4); | ||
| //console.log(typeof cardNumber); | ||
| const cardNumberStr = cardNumber.toString(); | ||
|
|
||
| const last4Digits = cardNumberStr.slice(-4); | ||
| console.log(last4Digits); // Output: "4213" | ||
|
|
||
| // 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 suspect the code doesn't work because the slice method is being called on a number, but slice is a method for strings. Therefore, I predict that the code will throw an error saying that slice is not a function for numbers. | ||
|
|
||
| // i console the typeof cardNumber and it returns 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,7 @@ | ||
| const 12HourClockTime = "8:53pm"; | ||
| const 24hourClockTime = "20:53"; | ||
| const twelveHourClockTime = "8:53pm"; | ||
| const twentyFourHourClockTime = "20:53"; | ||
| /*names beginning with $ or _ often carry special conventions: | ||
| _name often implies a private/internal variable. | ||
| $name is commonly associated with libraries like jQuery or special framework objects.*/ | ||
| /*For ordinary variables, it's usually clearer to start with a letter and use camelCase and avoid special characters, not starting with a number. and choosing meaningful names that describe the variable's purpose.*/ |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
Note: Usually the double quotes surrounding a string are not part of the sting value; they are only used to indicate the boundary of the string.
No change needed.
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.
Noted , Thanks