Repository navigation
Cape Town | 26-ITP-Sep | Raees Stevens | Sprint 2 | Coursework/sprint 2 #1640
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
RaeesStevens
wants to merge
40
commits into
CodeYourFuture:main
Choose a base branch
from
RaeesStevens: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
40 commits
Select commit
Hold shift + click to select a range
285587f
answered 1-count,js
RaeesStevens 647de99
added first character variable
RaeesStevens 484ff89
edit prep files
RaeesStevens 62ce6cc
updated template literal
RaeesStevens c1f4e1e
added template literal for intitials
RaeesStevens e736c2d
added console.log to initials.js
RaeesStevens 1ce816b
removed inverted commas from console.log
RaeesStevens 1d5ad56
added slice to dir variable
RaeesStevens 775c3f5
corrected grammar in const dir
RaeesStevens 868d352
Added LastDotIndex variable
RaeesStevens e6e1610
added ext print function
RaeesStevens ad31727
removed quotes in sliced ext variable
RaeesStevens edb729d
added print function to random,js
RaeesStevens d6ea3d3
unpacked expressions
RaeesStevens 6e1a31f
added let
RaeesStevens dd2cdbc
Added print function
RaeesStevens d77e8e2
removed second declaration of age variable
RaeesStevens 0bec30f
removed back ticks and replaced with quotes
RaeesStevens ecbb8e1
put variable above print function
RaeesStevens 216b40b
put variable first
RaeesStevens 8cb21df
added print function for last4Digits
RaeesStevens 624fc64
added template literal
RaeesStevens a5119eb
added $ to template literal
RaeesStevens 58e31bf
added explanation for answer
RaeesStevens 5f2d6e0
Added print function for 12hour clocl
RaeesStevens 43087db
changed numbers to words in variables
RaeesStevens a5213f2
added print for 24 hour clock time
RaeesStevens 3145e30
answered a)
RaeesStevens 72dfb0c
answered b)
RaeesStevens 6edc642
corrected answeer a
RaeesStevens efd42ad
answered e) and added line numbers to c) and d)
RaeesStevens a2df7b1
updated c, d and e
RaeesStevens 4e87ea5
added d and e answers
RaeesStevens ddaeb22
answered all questions
RaeesStevens 46fc1f2
removed accidentally comitted Prep submodule
c03010a
Updated answer to 1-count.js
RaeesStevens 18c0b10
updated answer to 4-random.js
RaeesStevens 6fff84a
Updated 3.js - swapped template literal with String(cardNumber)
RaeesStevens 75176a9
updated comment that String() was used
RaeesStevens 158e7ca
updated 4-random.js
RaeesStevens 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,4 +1,7 @@ | ||
| // 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,6 @@ | ||
| // 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}`); | ||
| 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,15 @@ | ||
| const cardNumber = 4533787178994213; | ||
| const last4Digits = cardNumber.slice(-4); | ||
| const last4Digits = String(cardNumber).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 | ||
|
|
||
| // Card Number is declared as a number and not a string, so slice won't work. | ||
| console.log(last4Digits); | ||
| // Yes this is what I predicted. The error is - cardNumber.slice is not a function. | ||
| // I used String() to convert the number to a string before slicing. | ||
|
|
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 twelveHourClockTime = "8:53pm"; | ||
| const twentyFourhourClockTime = "20:53"; | ||
|
|
||
| console.log(twelveHourClockTime); | ||
| console.log(twentyFourhourClockTime); | ||
|
|
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.
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.
Uh oh!
There was an error while loading. Please reload this page.