How to convert an object values to comma separated string in Node.js

1 Answer

0 votes
const obj = {
    q: 'Node.js',
    lang: 'en',
    limit: 15
};

const str = Object.values(obj).join(',');

console.log(str); 

  
  
  
  
/*
run:

Node.js,en,15
  
*/

 



answered May 15, 2022 by avibootz

Related questions

2 answers 191 views
1 answer 187 views
1 answer 161 views
1 answer 159 views
1 answer 139 views
...