- Source:
Methods
concat(glueopt, nullable, stringsnullable) → {String}
Simply concatenates strings with a glue part using array.join in a handy notation. You can also provide arguments to glue as a prepared array as the second parameter, in that case other parameters will be ignored.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
glue |
String |
<optional> <nullable> |
'' | the separator to use between single strings |
strings |
Array.<String> |
<nullable> |
list of strings to concatenate, either comma-separated or as single array |
- Source:
Returns:
the concatenated string
- Type
- String
Example
const finalCountdown = concat(' ... ', 10, 9, 8, 7, 6, '5', '4', '3', '2', '1', 'ZERO!');
const finalCountdown = concat(' ... ', [10, 9, 8, 7, 6, '5', '4', '3', '2', '1', 'ZERO!']);