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 111 views
1 answer 119 views
1 answer 132 views
1 answer 130 views
1 answer 132 views
1 answer 84 views
...