参考 join()

join()

Combines an array of strings into one string.

The first parameter, list, is the array of strings to join.

The second parameter, separator, is the character(s) that should be used to separate the combined strings. For example, calling join(myWords, ' : ') would return a string of words each separated by a colon and spaces.

示例

语法

join(list, separator)

参数

list
Array:

array of strings to combine.

separator
String:

character(s) to place between strings when they're combined.

Returns

String: combined string.
Notice any errors or typos? Please let us know. Please feel free to edit src/utilities/string_functions.js and open a pull request!

相关参考