코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>JavaScript Operators</title> </head> <body> <h1>대입 연산자</h1> <script> var x = 10, y = 10, z = 10; x = x - 5; document.write(x + "<br>"); y -= 5; // y = y - 5 와 같은 표현임. document.write(y + "<br>"); z =- 5; // z = -5 와 같은 표현임. document.write(z); </script> </body> </html>