Syntax Lookup

Enter some language construct you want to know more about.

+

This is the unified addition and string concatenation operator.

Since ReScript 12, + works with int, float, and bigint, and concatenates string values. The compiler specializes the operator from its operands.

ReScriptJS Output
let intResult = 1 + 2
let floatResult = 1.5 + 2.5
let stringResult = "Re" + "Script"

The older ++ string concatenation operator is still supported.

References