skip to content

Everyday Syntax

The language's building blocks: var, final and const, numbers and strings, cascades, loops, parameter lists and try/catch. Interviewers open with final versus const to test precision.

part ofDartoverview, primer and where to startread it →
on this pageshow

explore

questions

page 2 of 2

In Dart 3.7 and later, what does naming a local variable or parameter _ do, and what convention did it replace?

level: middleimportance: nice to knowfreq 18%

basics

~20 s

Since Dart language version 3.7, a local variable or parameter named _ is a non-binding wildcard: any initializer still runs, but the value cannot be read, and several _ may share one scope. It replaces the old _, __, ___ naming convention.

open as a page

showing 31–31 of 31