How to convert array to string with spaces in TypeScript

1 Answer

0 votes
const arr = ['typescript', 'c', 'c++'];

const str = arr.join(' ');

console.log(str);

  
  
  
  
/*
run:
  
"typescript c c++" 
  
*/

 



answered Jun 21, 2022 by avibootz
...