AssignmentOperator-3

 

Example of JavaScript -= Operator: var x=10; x-=6 will result into 4. See the code snippet:

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <h2>-= Operator</h2> <p id="sample"></p> <script> var x=10; x-=6; document.getElementById("sample").innerHTML = x; </script> </body> </html>
Output