[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/Operator_precedence [Back]  [Original]

- JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

. .

In this article

console.log(3 + 4 * 5); // 3 + 20
// Expected output: 23

console.log(4 * 3 ** 2); // 4 * 9
// Expected output: 36

let a;
let b;

console.log((a = b = 5));
// Expected output: 5

. 1 2 .

a 1 b 2 c

( ) , . .

js
console.log(3 + 10 * 2); // 23 
console.log(3 + 10 * 2); // 23 ,  
console.log((3 + 10) * 2); // 26 ,     

( ) (a 1 b) 2 c , ( ) a 1 (b 2 c) . .

js
a = b = 5; // a = (b = 5); 

a b 5 . b 5 , a b = 5 5 .

, (**) . .

js
function echo(name, num) {
    console.log(name + "  ");
    return num;
}
//   (/) 
console.log(echo("", 6) / echo("", 2));
  
  
3
js
function echo(name, num) {
    console.log(name + "  ");
    return num;
}
//   (**) 
console.log(echo("", 2) ** echo("", 3));
  
  
8

. . .

js
function echo(name, num) {
    console.log(name + "  ");
    return num;
}
//   (/) 
console.log(echo("", 6) / echo("", 2) / echo("", 3));
  
  
  
1
js
function echo(name, num) {
    console.log(name + "  ");
    return num;
}
//   (**) 
console.log(echo("", 2) ** echo("", 3) ** echo("", 2));
  
  
  
512
js
function echo(name, num) {
    console.log(name + "  ");
    return num;
}
//       
console.log((echo("", 2) ** echo("", 3)) ** echo("", 2));
  
  
  
64

6 / 3 / 2 (6 / 3) / 2 . 2 ** 3 ** 2 2 ** (3 ** 2) . (2 ** 3) ** 2 64 .

, . 2 ** 3 / 3 ** 2 (2 ** 3) / (3 ** 2) 0.8888888888888888 .

js
3 > 2 && 2 > 1;
// true 

3 > 2 > 1;
// 3 > 2 true,   true 1 
// true > 1 1 > 1 ,  .
//   (3 > 2) > 1 .

. ( ) , .

. a &&(b + c) a falsy (b + c) . ("OR") "" . ("AND"), nullish-coalescing, . .

js
a || b * c; // `a`  , `a` "truthy"  `a` .
a && b < c; // `a`  , `a` "falsy"  `a` .
a ?? (b || c); // `a`  , `a` `null` `undefined`  `a` .
a?.b.c; // `a`  , `a` `null` `undefined` `undefined` .

(19 1) .

19 ( )
18 .
[ ]
new ( ) new ( )
( )
?.
17 new ( ) new
16 ++
--
15 NOT !
NOT ~
+
-
++
--
typeof typeof
void void
delete delete
await await
14 **
13 *
/
%
12 +
-
11 <<
>>
>>>
10 <
<=
>
>=
in in
instanceof instanceof
9 ==
!=
===
!==
7 AND &
7 XOR ^
6 OR |
5 AND &&
4 OR ||
??
3 () ? :
2 =
+=
-=
**=
*=
/=
%=
<<=
>>=
>>>=
&=
^=
|=
&&=
||=
??=
yield yield
yield* yield*
1 / ,

Web Proxy Viewer  |  New URL  |  Original Page