Search⌘ K
AI Features

Operator Precedence

Explore how operator precedence in Dart affects the evaluation of expressions. Understand the order in which operators are applied to write accurate and reliable Dart code, preparing you for more advanced programming concepts.

We'll cover the following...

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 table

Below, you’ll find ...