Glasgow | 25-ITP-SEP | Fares Bakhet | Sprint 1 | coursework/sprint-1#724
Glasgow | 25-ITP-SEP | Fares Bakhet | Sprint 1 | coursework/sprint-1#724Fares-Bakhet wants to merge 18 commits intoCodeYourFuture:mainfrom
Conversation
…e line to print the result
|
|
||
| declaring a new variable priceAfterOneYear: | ||
| let priceAfterOneYear = "8,543"; | ||
| */ |
There was a problem hiding this comment.
priceDifference and percentageChange are also variables. Although their values are fixed after assignment due to the use of the const keyword, they are still considered variables in JavaScript.
There was a problem hiding this comment.
@tenzyns, I missed these two🤔😥 I will add them now.
Thanks a lot.
| // d) Interpret line 4, what does the expression assigned to totalMinutes mean? | ||
|
|
||
| /* | ||
| The expression gives the completed total minutes of the movie, by subtract the movie length in sec from the remaining seconds and divide the result by 60 to convert it to minutes |
There was a problem hiding this comment.
You're correct. Just to slightly rearrange the wording, you could say 'subtract the remainingSeconds from the movieLength...'
| /* | ||
| The variable result shows(display) the total length of the movie in three sections (Hours:Minutes:seconds) in string format. | ||
|
|
||
| I can think of "MovieDuration" as a better name because it gives more description to the output. |
There was a problem hiding this comment.
It's a convention to start a variable name with lowercase, though not a rule.
There was a problem hiding this comment.
@tenzyns, I just heard this info on a video a couple of hours ago😁😁 it's like writing code.
| Answer: | ||
| -console is a built-in object. | ||
| -log and assert are properties of that object, specifically functions (methods). | ||
| -The console.assert() static method writes an error message to the console if the assertion is false. If the assertion is true, nothing happens. |
There was a problem hiding this comment.
for console.assert(condition, message); you provide a boolean expression as the 1st argument and message string if false.
There was a problem hiding this comment.
@tenzyns ,
Do I need to rephrase my expression, for example, [if the condition is false, it prints an error message in the console. If the condition is true, it doesn’t output anything. Should I avoid using Boolean words (true, false)?
There was a problem hiding this comment.
@Fares-Bakhet, Apologies, didn't get notified of this. No you don't need to rephrase. Just to be aware of the what arguments it accepts.
Learners, PR Template
Self checklist
Changelist
I have made all the changes required and run the tests needed.
Questions
No questions.