...

/

Discussion: Negative Gravity

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.

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. ...

Understanding the output