-
-
Notifications
You must be signed in to change notification settings - Fork 241
London | 25-ITP-September | Ammad Ur Rehman | Sprint 1 | 03 Complete Sprint 1 Coursework #785
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 2 commits
9a1b9a4
18a20f4
d428922
6a17974
6dbf419
c43a664
56a3e38
88aee46
ceae1cf
ea93025
1383234
8d02051
26947d3
8f9c9d3
f77fa4d
7659c5a
a4ffc85
3aa28fa
b4c662e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ console.log(`The percentage change is ${percentageChange}`); | |
| // Read the code and then answer the questions below | ||
|
|
||
| // a) How many function calls are there in this file? Write down all the lines where a function call is made | ||
| // Line 4, 5 | ||
| // Line 4, 5, 10 | ||
|
||
|
|
||
| // b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem? | ||
| // It's missing a comma between the arguments at line 5 in replaceAll() method | ||
|
|
@@ -24,5 +24,5 @@ console.log(`The percentage change is ${percentageChange}`); | |
| // Line 1, 2 | ||
|
|
||
| // e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? | ||
| // Its purpose is to replace a substring with another string, in this case, replaces a command (",") with an empty string ("") | ||
| // In order words, remove the comma (",") in the string | ||
| // Its purpose is to replace a substring with another string and then convert it into a number, in this case, replaces a command (",") with an empty string ("") | ||
| // In other words, remove the comma (",") in the string and then convert it into a number | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,4 +26,4 @@ It displays an alert with a textfield where you can enter some text, e.g. John. | |
|
|
||
| What is the return value of `prompt`? | ||
|
|
||
| The string returned from the textfield what the user has entered otherwise null. | ||
| The string returned from the textfield what the user has entered otherwise null if the user left it blank. | ||
|
||
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.
How do you figure it is [0, 1] and not [0, 1)?