How to convert array to string with spaces in Node.js

1 Answer

0 votes
const arr = ['node.js', 'c', 'c++'];

const str = arr.join(' ');

console.log(str);

  
  
  
  
/*
run:
  
node.js c c++
  
*/

 



answered Jun 21, 2022 by avibootz

Related questions

1 answer 196 views
1 answer 203 views
1 answer 242 views
1 answer 217 views
1 answer 241 views
1 answer 196 views
...