Ubah string menjadi array array dengan objek.entries ()
const object1 = "xxxxx";
console.log(Object.entries(object1));
/*creates [[0, "x], [1, "x"], [2, "x"], [3, "x"], [4, "x"]]
Javasper