Last updated 4 years ago
Was this helpful?
split as array
iterate process-1 array and repeat two times of array element
join array as one string and return
const doubleChar = (str) => [...str].map((v) => v.repeat(2)).join('');