Last time, we explored basic math operations like +
, -
, *
, and /
in JavaScript.
We also saw that *
and /
usually happen before +
and -
.
Engagement Message
So, in 5 + 2 * 3
, which part is calculated first?
As programs get longer, it's helpful to leave notes inside the code. These notes are for humans reading the code, not for the computer.
Think of them like sticky notes explaining what a part of your program does.
Engagement Message
Make sense?
In JavaScript, you can write these notes, called comments, by starting a line with two forward slashes (//
).
Anything on a line after //
is completely ignored by the computer when you run the code.
Engagement Message
Can you write for me a simple one word comment?
