Conversation
✅ Deploy Preview for cyf-onboarding-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
||
| // Answers | ||
|
|
||
| // a) There are no function or function calls in this code. |
There was a problem hiding this comment.
How are functions usually invoked in JS?
|
|
||
| // a) There are 6 variable declarations. | ||
|
|
||
| // b) There are no function calls. |
There was a problem hiding this comment.
Similar question to the one I left in previous file
| // Try logging the value of num and running the program several times to build an idea of what the program is doing | ||
|
|
||
| // 1. num is a variable that stores the final result of the expression assigned to it. | ||
| // 2. The Math.random() method generates a random decimal number from 0 up but not excluding 1. |
There was a problem hiding this comment.
Could be worth having another look at Math.random docs here.
| const dir = ; | ||
| const ext = ; | ||
| const dir = filePath.slice(0, lastSlashIndex); | ||
| const ext = filePath.slice(-3); |
There was a problem hiding this comment.
Can you think of a more robust way to find extention?
| @@ -1,9 +1,16 @@ | |||
| const cardNumber = 4533787178994213; | |||
| const last4Digits = cardNumber.slice(-4); | |||
| const last4Digits = Number(String(cardNumber).slice(-4)); | |||
There was a problem hiding this comment.
Can you think of any edge cases that could surface here?
|
|
||
| // c) The reminder (%) operator returns the reminder left over when one operand is divided by a second operand. | ||
|
|
||
| // d) movieLength(8784) - remainingSeconds(24) = 8760(seconds). 8760 / 60 gives us 146 minutes. totalMInutes = 146 |
There was a problem hiding this comment.
Nice! Great example of using real numbers to make explanation super clear.
|
Good job! Very clear explanations/answers to most questions. Only few small bits to revisit here. |

Learners, PR Template
Self checklist
Task code
CYF-1039
Changelist
Using documentations errors explained fixed. Program explained step by step.