How to combine elements from array into a string in JavaScript

1 Answer

0 votes
let arr = ["c++", "javascript", "php", "python", "go"];
  
let s = arr.join("/");

console.log(s);
  


  
/*
run:
       
c++/javascript/php/python/go
          
*/

 



answered Aug 30, 2020 by avibootz
...