Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Incrementing and Decrementing Operators</title> </head> <body> <script> let x; // Declaring Variable x = 10; document.write(++x); // Prints: 11 document.write("<p>" + x + "</p>"); // Prints: 11 x = 10; document.write(x++); // Prints: 10 document.write("<p>" + x + "</p>"); // Prints: 11 x = 10; document.write(--x); // Prints: 9 document.write("<p>" + x + "</p>"); // Prints: 9 x = 10; document.write(x--); // Prints: 10 document.write("<p>" + x + "</p>"); // Prints: 9 </script> </body> </html>