javascriptの基本:演算子の優先順位
<DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>演算子の優先順位</title> </head> <body> <script type="text/javascript"> document.write('2×8-6÷2=',(2*8-6/2),'<br>'); document.write('2×(8-6)÷2=',(2*(8-6)/2),'<br>'); document.write('1-2+3=',(1-2+3),'<br>'); document.write('1-(2+3)=',(1-(2+3)),'<br>'); </script> </body> </html>