Discussion: Negative Gravity
Execute the code to understand the output and gain insights into how JavaScript handles double negative signs, arithmetic operations, and the decrement operator.
We'll cover the following...
Verifying the output
Now, it’s time to execute the code and observe the output.
Press + to interact
console.log(7 - - 5);console.log(7 - -5);console.log(7- -5);//console.log(7--5); // SyntaxError
Run the code twice: once, as it is, and then remove the comment //
on line 4 and run the code again. ...