Why does my text disappear in javascript?

Here is my code

const p = document.getElementById("looper");
function shiftright() {
    let temp = new String();
    for(var i = 1; i < p.textContent.length - 1; i++)
    {
        temp[i] = p[i-1];
    }
    temp[0] = p.textContent[p.textContent.length-1];
    p.textContent = temp;
}
window.setInterval(shiftright, 1000);

Whenever I run it the text within the element disappears once the interval expires. I am trying to make the text loop around.