Glasgow | Jan-26 | Elisabeth Matulian | Sprint 1 | Coursework#936
Glasgow | Jan-26 | Elisabeth Matulian | Sprint 1 | Coursework#936Elisabeth-Matulian wants to merge 22 commits intoCodeYourFuture:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Sprint-1/1-key-exercises/3-paths.js
Outdated
| const dir = ; | ||
| const ext = ; | ||
|
|
||
| const dir = filePath.slice(0, filePath.lastIndexOf("/",lastSlashIndex - 1)); |
There was a problem hiding this comment.
Can you take a look at the output this line gives you and check if it aligns exactly with the full dir path as indicated in the task?
There was a problem hiding this comment.
I removed the second parameter from lastIndexOf and reused the existing lastSlashIndex variable
Sprint-1/2-mandatory-errors/3.js
Outdated
There was a problem hiding this comment.
Yes, you updated the cardNumber variable, but you need to explain your reasoning behind it as indicated in the comments for the task.
There was a problem hiding this comment.
My bad:)
I initially thought this reasoning should be done mentally rather than written in the code. Thanks for mention it
Sprint-1/2-mandatory-errors/4.js
Outdated
| const 12HourClockTime = "20:53"; | ||
| const 24hourClockTime = "08:53"; No newline at end of file | ||
| const ClockTime12Hour = "20:53"; | ||
| const ClockTime24Hour = "08:53"; No newline at end of file |
There was a problem hiding this comment.
Very good variable naming convention. A bit of explanation with comments as to why you got an error and how you figured out the solution would help better practice.
There was a problem hiding this comment.
Thanks. Comment added
| // d) This way, we find out how many full minutes the film lasts. | ||
|
|
||
| // e) What do you think the variable result represents? Can you think of a better name for this variable? | ||
| // e) This variable stores information about the exact length of the film (hours:minutes:seconds). I would call it “hoursMinutesSeconds” |
There was a problem hiding this comment.
This part is really subjective, but if you could go with a better variable name based on the context provided from the existing variable names, that would be better.
There was a problem hiding this comment.
I updated the name of the variable
Sprint-1/4-stretch-explore/chrome.md
Outdated
| What is the return value of `prompt`? | ||
| Answer: undefined |
There was a problem hiding this comment.
You can recheck if the return type is actually what you say it is. If you input your name in the prompt, you should get the datatype for your name returned.
There was a problem hiding this comment.
updated with the correct answer
Theoreoluwa
left a comment
There was a problem hiding this comment.
Kindly look into my comments and adjust them accordingly. Great job so far, keep going!
| // 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 | ||
| // a) Lines 4,5,10 |
There was a problem hiding this comment.
You need to include a number of function calls in there after looking into each line properly.
There was a problem hiding this comment.
answer added for the first question. I need to be more attentive%)
There was a problem hiding this comment.
Thank you for checking my coursework and for your detailed feedback. I have updated it. Could you please take another look when you have a moment?
| // .slice() method works with String type, not with Number type. Therefore there will be an error | ||
| // 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 | ||
| // the error is: "TypeError: cardNumber.slice is not a function" this matches my prediction. The error occurred because the method doen't work with Number type. I've changed cardNumber to a String when added quotes around the number. No newline at end of file |
There was a problem hiding this comment.
Now, you did the right thing by explaining your reasoning to debug the error. I would suggest applying a much cleaner way to convert the variable into a string without redeclaring it. You can look into that method using MDN docs.
| const ClockTime12Hour = "20:53"; | ||
| const ClockTime24Hour = "08:53"; | ||
| // variable names cannot start with a number in JavaScript syntax No newline at end of file |
There was a problem hiding this comment.
Good comment. I would advise you use camelCase as your variable naming convention instead of PascalCase as that is more suitable for class names.
| What effect does calling the `prompt` function have? | ||
| Answer: A window pops up in the browser with a text input field | ||
| What is the return value of `prompt`? | ||
| Answer: the text that I entered in the input field that is stored in myName variable No newline at end of file |
There was a problem hiding this comment.
Good explanation, but you need to learn to explicitly state the data type you are referring to when answering questions from the task.
Theoreoluwa
left a comment
There was a problem hiding this comment.
You've done very well, Elisabeth. Please, pay attention to my comments, as you will find them relevant as you carry on your journey. I will now mark your sprint PR as completed. Good luck and keep going!
Self checklist
Changelist