How to convert array of words to make a sentence?

前端 未结 3 1117
情书的邮戳
情书的邮戳 2021-01-18 05:36

I feel uncomfortable asking, but how do I convert an array of words to make a sentence ?

I keep finding the other way round.

Something like:



        
3条回答
  •  不要未来只要你来
    2021-01-18 06:04

    Just join the elements of the array into a string using a space as a separator:

    var sentence = a.join(" ");
    

    https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/join

提交回复
热议问题