JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test"></div>

JavaScript

function gi(id){return document.getElementById(id)}

    a= [1,5,1,2,3,5,3,4,3,4,3,1,3,6,7,752,23]


for(i=0; i < a.length; i++){
    /*
    if (WHAT AND WHAT){ What do I add here to know that the last value in the array was used? (For this example, it's the number: 23. Without doing IF==23.
        
    }
    */
    
    gi('test').innerHTML+=''+a[i]+' <br>';
}