영상
개념
<script>
/*
[개념] 연산자 우선순위
[1] 곱하기와 나누기는 더하기 빼기 보다 우선순위가 높다.
[2] 더하기나 빼기를 곱하기 또는 나누기 보다 먼저 하고 싶은면
() 소괄호를 이용해야 한다.
[예]
10 + 3 * 3 ==> 19
(10 + 3) * 3 ==> 39
[3] 우선순위표
1. ()
2. * / %
3. + -
*/
console.log("[연산자 우선순위]");
console.log(10 + 3 * 3);
console.log((10 + 3) * 3);
document.write("[연산자 우선순위]<br>");
document.write(10 + 3 * 3 + "<br>");
document.write((10 + 3) * 3 + "<br>");
</script>
Java
복사