Tips for golfing in Haxe What general tips do you have for golfing in Haxe? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Haxe (e.g. "remove comments" is not an answer).

Please post one tip per answer.

Haxe can be run online here!
String interpolation

Haxe supports string interpolation on single-quote strings. Like template strings in JavaScript ES6, you can include an expression in a string with ${...}:

trace('2 + 2 = ${2 + 2}');


Unlike ES6, however, you can omit the curly brackets when the expression is a single variable:

var x = 2 + 2;
trace('2 + 2 = $x');


Both of these examples print 2 + 2 = 4.