We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
JavaScript Operator Precedence Checker
If this tool helped you, you can buy us a coffee ☕
Quickly check JavaScript operator precedence and associativity to avoid logic errors in your code.
( )Grouping ExpressionsNon-associative用括号显式改变表达式求值顺序,括号内先计算。
(a + b) * c.Member & CallLeft-associative访问对象的命名属性。
user.name[]Member & CallLeft-associative用表达式结果作为属性名或数组索引。
items[index]?.Member & CallLeft-associative对象为空值时短路返回 undefined,避免继续访问时报错。
user.profile?.email()Member & CallLeft-associative调用函数、方法或可调用表达式。
format(value)new ...()Member & CallLeft-associative创建构造函数实例,并传入参数列表。
new Date(2026, 0, 1)newObject CreationRight-associative创建构造函数实例;省略调用括号时优先级低于成员访问和函数调用。
new Datex++PostfixNon-associative返回变量当前值,然后将变量加 1。
count++x--PostfixNon-associative返回变量当前值,然后将变量减 1。
count--++xUnaryRight-associative先将变量加 1,再返回新值。
++count--xUnaryRight-associative先将变量减 1,再返回新值。
--count!UnaryRight-associative将值转换为布尔值后取反。
!isReady~UnaryRight-associative将操作数转为 32 位整数后逐位取反。
~mask+xUnaryRight-associative尝试将操作数转换为数字。
+inputValue-xUnaryRight-associative将操作数转换为数字后取相反数。
-pricetypeofUnaryRight-associative返回操作数类型的字符串描述。
typeof valuevoidUnaryRight-associative计算表达式并返回 undefined。
void fn()deleteUnaryRight-associative删除对象上的可配置属性。
delete user.tempawaitUnaryRight-associative在 async 函数或模块顶层等待 Promise 结果。
await fetchData()**ExponentiationRight-associative计算左操作数的右操作数次幂;左侧不能直接是一元表达式。
2 ** 3 ** 2*MultiplicativeLeft-associative两个数值相乘。
width * height/MultiplicativeLeft-associative左操作数除以右操作数。
total / count%MultiplicativeLeft-associative返回除法后的余数。
index % 2+AdditiveLeft-associative数值相加;任一操作数为字符串时通常执行字符串连接。
firstName + lastName-AdditiveLeft-associative两个数值相减。
end - start<<Bitwise ShiftLeft-associative将 32 位整数按位左移。
1 << bit>>Bitwise ShiftLeft-associative保留符号位进行右移。
value >> 1>>>Bitwise ShiftLeft-associative高位补 0 进行右移。
value >>> 1<RelationalLeft-associative比较左操作数是否小于右操作数。
age < 18<=RelationalLeft-associative比较左操作数是否小于或等于右操作数。
score <= 100>RelationalLeft-associative比较左操作数是否大于右操作数。
price > limit>=RelationalLeft-associative比较左操作数是否大于或等于右操作数。
count >= mininRelationalLeft-associative判断指定属性名是否存在于对象或其原型链中。
"name" in userinstanceofRelationalLeft-associative判断对象是否出现在构造函数的原型链上。
value instanceof Date==EqualityLeft-associative允许类型转换后比较两个值是否相等。
value == null!=EqualityLeft-associative允许类型转换后比较两个值是否不相等。
value != 0===EqualityLeft-associative不进行类型转换,比较类型和值是否都相同。
status === "ok"!==EqualityLeft-associative不进行类型转换,判断类型或值是否不同。
status !== "ok"&BitwiseLeft-associative两个 32 位整数逐位执行与运算。
flags & enabled^BitwiseLeft-associative两个 32 位整数逐位执行异或运算。
flags ^ mask|BitwiseLeft-associative两个 32 位整数逐位执行或运算。
flags | selected&&LogicalLeft-associative左侧为假值时短路返回左侧,否则返回右侧。
user && user.name||LogicalLeft-associative左侧为真值时短路返回左侧,否则返回右侧。
name || "匿名"??Nullish CoalescingLeft-associative左侧为 null 或 undefined 时返回右侧;与 &&、|| 混用时需要加括号。
count ?? 0?:Conditional (Ternary)Right-associative根据条件表达式结果在两个分支表达式中选择一个。
score >= 60 ? "通过" : "未通过"=AssignmentRight-associative将右侧表达式结果赋给左侧引用。
total = 0+=AssignmentRight-associative等价于把当前值与右侧值相加后再赋回。
total += price-=AssignmentRight-associative等价于把当前值减去右侧值后再赋回。
count -= 1*=AssignmentRight-associative等价于把当前值乘以右侧值后再赋回。
size *= 2/=AssignmentRight-associative等价于把当前值除以右侧值后再赋回。
size /= 2%=AssignmentRight-associative等价于把当前值取余后再赋回。
index %= length**=AssignmentRight-associative等价于对当前值执行幂运算后再赋回。
value **= 2<<=AssignmentRight-associative等价于左移后再赋回。
mask <<= 1>>=AssignmentRight-associative等价于有符号右移后再赋回。
mask >>= 1>>>=AssignmentRight-associative等价于无符号右移后再赋回。
mask >>>= 1&=AssignmentRight-associative等价于按位与后再赋回。
flags &= mask^=AssignmentRight-associative等价于按位异或后再赋回。
flags ^= mask|=AssignmentRight-associative等价于按位或后再赋回。
flags |= mask&&=AssignmentRight-associative左侧为真值时,才将右侧结果赋给左侧。
enabled &&= isAdmin||=AssignmentRight-associative左侧为假值时,才将右侧结果赋给左侧。
title ||= "未命名"??=AssignmentRight-associative左侧为 null 或 undefined 时,才将右侧结果赋给左侧。
options.timeout ??= 3000=>AssignmentRight-associative定义箭头函数表达式。
(x) => x * 2yieldAssignmentRight-associative在生成器函数中暂停执行并产出一个值。
yield valueyield*AssignmentRight-associative把产出过程委托给另一个可迭代对象。
yield* list,CommaLeft-associative从左到右依次求值,整个表达式结果为最后一个表达式。
(x += 1, x * 2)
JavaScript Regex Tester
Test and debug JavaScript regular expressions in real-time, with detailed match results, capture groups, and index information.
JavaScript Obfuscator
Free online JavaScript obfuscator to hide your original logic, protect source code, and prevent reverse engineering or unauthorized modifications.

JavaScript Events Reference Table & Compatibility List
An online reference guide for front-end developers to quickly look up JavaScript event names, categories, and browser compatibility.
When writing complex JavaScript expressions, different operator precedences can often lead to unexpected calculation results. This tool directly solves the problem of unclear operator precedence. By entering any JS operator symbol or name, it instantly returns the operator's precedence level, associativity, and a brief description, helping developers accurately predict the evaluation order of expressions.
+, *, &&, or ===.&&, Output: Precedence 6, Left-to-right associativity, Logical AND operator.. and [], along with new (with argument list) and function calls (), have the highest precedence at level 20, and all have left-to-right associativity.a - b + c is equivalent to (a - b) + c; assignment operators are right-associative, so a = b = 5 is equivalent to a = (b = 5).This tool only supports standard JavaScript operator symbols; custom operators or non-operator characters are not supported. Results are based on the latest ECMAScript specification, though different host environments or very early engines may have slight variations—always refer to your actual runtime environment. This tool operates entirely on the front end and will not record or upload any of your input data.
When reading or writing complex expressions, it is highly recommended to use parentheses () to clarify your intent. Even if the precedence is known, parentheses significantly improve code readability and maintainability. Here is a quick precedence cheat sheet: Multiplicative operators (* / %, level 14) are higher than additive operators (+ -, level 13); Relational operators (< <= > >=, level 11) are higher than equality operators (== != === !==, level 10); Logical AND && (level 6) is higher than Logical OR || (level 5). In conditional statements and type checking, if you need to combine multiple operators, feel free to use this tool to quickly verify precedence and effectively avoid logic errors caused by misunderstandings.