let d = '06/22/2022'.split('/') d = d[2].concat(d[0], d[1]) console.log(typeof d, d) // string 20220622