Concatenation
Concatenations are supported for values of type String
and arrays. In both cases they are expressed via the operator +
. For instance, "Hello " + "world!"
evaluates to "Hello world!"
, and [1, 2, 3] + [4, 5, 6]
evaluates to [1, 2, 3, 4, 5, 6]
.
Concatenating two arrays requires that both arrays be of the same type, in contrast to constructing an array literal where a common base type for all array items is determined. This is because arrays are treated as invariant. The type of the entire expression matches the type of the operands.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for