-
-
Notifications
You must be signed in to change notification settings - Fork 197
London | May 2025 | Victoria Scott | Sprint 1 Coursework #684
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?
London | May 2025 | Victoria Scott | Sprint 1 Coursework #684
Conversation
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 here @VictoriaScottCodes
I gave some minor feedback.
We don't want the computer to run these 2 lines - how can we solve this problem? | ||
|
||
// To stop the computer from running those two lines, we can turn them into comments by adding // at the beginning of each line. This tells the computer to ignore the line because it is only meant for humans to read. |
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.
Do you think you can implement the solution you provided? That is adding // at the beginning of each line?
@@ -7,3 +7,5 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum; | |||
// Try breaking down the expression and using documentation to explain what it means | |||
// It will help to think about the order in which expressions are evaluated | |||
// Try logging the value of num and running the program several times to build an idea of what the program is doing | |||
|
|||
// The variable num stores a random whole number between 1 and 100. The code uses Math.random() to get a number between 0 and 1. It then multiplies that number to get a value between 0 and 100. Math.floor() rounds it down to a whole number. Finally, it adds 1 so the result is between 1 and 100. Each time you run the code, num will be a different number in that range. |
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.
Do you think you could go further by writing some tests to confirm this?
|
||
Now enter just `console` in the Console, what output do you get back? | ||
console {debug: ƒ, error: ƒ, info: ƒ, log: ƒ, warn: ƒ, ...} | ||
|
||
Try also entering `typeof console` |
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.
What output would you get back from entrying typeof console
?
Self checklist
Answering questions in Sprint 1