-
-
Notifications
You must be signed in to change notification settings - Fork 546
London | 26-ITP-Sep | Rawan Almutairi | Sprint2 | JavaScript exercises #1628
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
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. Great job! This is a very clean and clever solution using template literals and bracket notation. Quick question: Is there another built-in string method besides bracket notation you could use to get the first character? |
|
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. Spot-on implementation for extracting Quick question: When using |
|
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. Clear breakdown of the math logic! Just remember the order: Quick question: What purpose does the |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| 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? | ||
|
|
||
| //we use slash to comment it. So the computer doesn't excute the text. |
|
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. Spot-on distinction between Quick question: Is there a shorthand assignment operator you could use instead of writing |
| 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; | ||
| let age = 33; | ||
| age = age + 1; | ||
|
|
||
| //we change the variable declaration and reassign its value | ||
| // variable declaration keywords | ||
| // const can't be used to reassign a value | ||
| // let can be used to reassign a value |
|
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. Accurate explanation! Trying to use Quick question: Do you know the technical term for the area in the code before a |
|
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. Not quite a ReferenceError here— Quick question: What method can you call on |
|
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. Spot-on explanation! Variable names cannot start with numbers. Quick question: While starting with a capital letter works syntactically, what is the standard JavaScript naming convention (case style) usually used for variables made of multiple words like this? |
| 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"; | ||
| // an identifier or keyword can't follow a numeric literal. We fix this by writing the numbers in words format | ||
|
|
||
| //const 12HourClockTime = "8:53pm"; | ||
| //const 24hourClockTime = "20:53"; |
|
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. Spot-on answers! Your breakdown of line 5's syntax error, reassignments, and the purpose of Quick question: Why is |
|
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. Spot-on analysis! Your observation about leading zeros triggering an octal syntax error is a brilliant and advanced catch. Quick question: If |
|
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. Great step-by-step breakdown! You clearly traced how Quick question: Why is |
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.
Great job! You correctly identified how the variable is initialized and reassigned.
Quick question: How would you specifically describe the role of the
=sign in that second line?