...

/

Operator Precedence

Operator Precedence

Let’s study the operators that hold precedence over others.

Overview

Operator precedence determines the order with which different parts of the code/expression should be evaluated. For instance, 1 + 1 * 5 would give us 6 rather than 10 as * has higher precedence than +. If we wanted 10 we could write the expression as (1 + 1) * 5 as () has higher precedence than *.

Precedence

...

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy