How to convert char array into a single int in Node.js

1 Answer

0 votes
const arr = ['3', '9', '0', '8', '6', '1'];
        
const n = parseInt(arr.join(''), 10);
        
console.log(n);



/*
run:

390861

*/

 



answered Sep 23, 2022 by avibootz
...