generated from CodeYourFuture/Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 195
Glasgow | ITP May -25 | Pandi Simatupang | Module-Structuring-and-Testing-Data | coursework/sprint-1 #649
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
PandiSimatupang
wants to merge
27
commits into
CodeYourFuture:main
Choose a base branch
from
PandiSimatupang: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
Glasgow | ITP May -25 | Pandi Simatupang | Module-Structuring-and-Testing-Data | coursework/sprint-1 #649
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
3c0525b
add comment on the last line of file 1-count.js
PandiSimatupang 168186a
add console.log() to verify the value of count
PandiSimatupang 72645b8
add function getInitial in 2-initials.js and print to verify
PandiSimatupang 006df3d
solve exercise sprint1/3-paths.js
PandiSimatupang 998a7ee
comment and study exercise sprint-1/4-random.js
PandiSimatupang 63a8de0
solve exec. sprint1/mandatory-errors/0.js
PandiSimatupang 04cb872
study exec. sprint-1/2-mandatory-errors/1.js
PandiSimatupang 55aaa5f
solve exec. sprint-1/2-mandatory-errors/2.js
PandiSimatupang c1d3745
solve exec. sprint-1/2-mandatory-errors/3.js
PandiSimatupang a4496e3
solve exec. sprint-1/2-mandatory-errors/4.js
PandiSimatupang 13835fb
solve exec. sprint-1/3-mandatory-interpret/1-percentage-change.js
PandiSimatupang 4bc0b4b
solve exec. sprint-1/3-mandatory-interpret/2.js
PandiSimatupang e678b92
update solution 2-time-format.js
PandiSimatupang a5cd1c5
comment out sprint-1/3-mandatory-interpret/3-to-pounds.js
PandiSimatupang 1f7f9e2
tried sprint-1/4-stretch-explore/chrome.md
PandiSimatupang a8546b9
study and comment out sprint-1/4-mandatory-explore/objects.md
PandiSimatupang 65e1a8e
end of Sprit-1
PandiSimatupang 100b9fd
reset to origin file Sprint-2/1-key-errors/0.js
PandiSimatupang 95efc71
reset file Sprint-2/1-key-errors/1.js
PandiSimatupang ce9e5c1
reset Sprint-2/1-key-errors/2.js
PandiSimatupang a638efe
reset file Sprint-2/2-mandatory-debug/0.js
PandiSimatupang 5ae319d
reset file Sprint-2/2-mandatory-debug/1.js
PandiSimatupang f45625e
reset file Sprint-2/2-mandatory-errors/2.js
PandiSimatupang d8f561b
reset file Sprint-2/3-mandatory-implement/1-bmi.js
PandiSimatupang 08290c6
reset file Sprint-2/2-mandatory-implement/2-cases.js
PandiSimatupang 3bb0a7c
reset file Sprint-2/2-mandatory-implement/3-to-pounds.js
PandiSimatupang 8665943
change const to let Sprint-1/2-mandatory-errors/1.js
PandiSimatupang 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,9 @@ | ||
// trying to create an age variable and then reassign the value by 1 | ||
|
||
const age = 33; | ||
//create variable age | ||
let age = 33; | ||
|
||
//reassign variable age by 1 (+1) | ||
age = age + 1; | ||
|
||
console.assert(age); //Oh no.. that is mr. const |
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,8 @@ | ||
// 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}`); | ||
|
||
//it's not working because variable cityOfBirth was not defined. | ||
//change the position of -- const cityOfBirth = "Bolton"; -- before the logging will fix the 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,9 +1,13 @@ | ||
const cardNumber = 4533787178994213; | ||
const last4Digits = cardNumber.slice(-4); | ||
const cardNumberStr = cardNumber.toString(); | ||
const last4Digits = cardNumberStr.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. | ||
console.log(last4Digits); | ||
// Consider: Why does it give this error? Is this what I predicted? If not, what's different? | ||
//can not slice a number, the given card number is integer NOT a List or array | ||
// Then try updating the expression last4Digits is assigned to, in order to get the correct value | ||
//fix by give double quotes to turn the number to sting or make a new variable assign cardNumber.toString() |
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,5 @@ | ||
const 12HourClockTime = "20:53"; | ||
const 24hourClockTime = "08:53"; | ||
const ClockTime_12Hour = "20:53"; | ||
const ClockTime_24hour = "08:53"; | ||
|
||
//variable name convention issues... | ||
//variable name should not started 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
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.
That would not work as we cannot reassign variables declared with
const
. What other ways can you think of that can allows us to do what we want?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 wasn't aware of "const".. I need to change the variable type (to "let") so it can be reassigned.
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.
Exactly,
let
would be the correct approach here. If you do not need to reassign a variable always useconst
. This ensures that your variable will have the information you expect it to have.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.
Thanks.