(PCC)::[How-to-use-The-decrement-operator-in-JavaScript]::[js]
<!DOCTYPE html> <html> <body> <h2>JavaScript Operators</h2> <p>In this example, y is decremented before it is assigned to x (pre-decremented).</p> <p id="demo1"></p> <p id="demo2"></p> <script> var y = 5; var x = --y; document.getElementById("demo1").innerHTML = y; document.getElementById("demo2").innerHTML = x; </script> </body> </html>
In this example, y is decremented before it is assigned to x (pre-decremented).