London | 26-ITP-May | Jorvan White | Sprint 1 | Coursework - #1483
London | 26-ITP-May | Jorvan White | Sprint 1 | Coursework#1483JorvanW wants to merge 15 commits into
Conversation
of each name and concatenate them to form the initials.
…ring, not a number, to use the slice method correctly.
to explain each step of the code.
chrome.md and objects.md
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| console.log(`I was born in ${cityOfBirth}`); | ||
| const cityOfBirth = "Bolton"; | ||
| console.log(`I was born in ${cityofBirth}`); | ||
| const cityofBirth = "Bolton"; | ||
| //Spelling Error - cityofBirth is misspelled as cityOfBirth in the console.log statement. No newline at end of file |
There was a problem hiding this comment.
The error is not caused by any misspelled identifier. The updated code has the same error as the original code.
| const cardNumber = 4533787178994213; | ||
| const cardNumber = "4533787178994213"; | ||
| const last4Digits = cardNumber.slice(-4); |
There was a problem hiding this comment.
Suppose you were not allowed to modify the statement const cardNumber = 4533787178994213;
(that is, keep the variable's value unchanged).
How would you modify the code (through type conversion) to still being able to use .slice(-4) to extract the last 4 digits from the given number.
| // 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? | ||
| //Line 5 Column 60 was missing a ',' to separate the fuction. |
There was a problem hiding this comment.
The error occurred because a comma was missing between the a___________s.
What is the programming term that belongs in the blank?
| // The expression is an Assignment operator that assigns its right hand side value and equation to the variable on the left hand side. | ||
|
|
||
| // e) What do you think the variable result represents? Can you think of a better name for this variable? | ||
| // The variable result represents the total hours,minutes and seconds of the movie. A better name for this could be runtime or duration. |
There was a problem hiding this comment.
Both runtime and duration does not quite indicate the value stored in the variable
is a formatted string in the form "2:12:02".
Could you suggest a more descriptive name?
| What effect does calling the `prompt` function have? | ||
| What is the return value of `prompt`? | ||
| What effect does calling the `prompt` function have? It gives you a prompt window to input a value | ||
| What is the return value of `prompt`? A string/text containing my name |
There was a problem hiding this comment.
What does the function return when a user clicks "Cancel" instead of "OK"?
Learners, PR Template
Self checklist
Changelist
This Pull request is for Sprint 1 for Module Structuring and Comparing Data. I have completed all task to my capabilities and is submitting for review.