How to convert a comma separated string to array in Node.js

1 Answer

0 votes
const str = "node.js,php,c,c++,python";
 
const arr = str.split(',');
 
console.log(arr);
 
 
     
     
/*
run:
     
[ 'node.js', 'php', 'c', 'c++', 'python' ]
     
*/

 



answered Jun 19, 2022 by avibootz

Related questions

2 answers 184 views
1 answer 155 views
1 answer 151 views
1 answer 145 views
2 answers 160 views
1 answer 129 views
...