info before: i have halfway succeded, as i managed to print out it and it didnt loop crazy, however i did not manage to find the reason why it still prints out a undefinded

---

```
HTML: <button id="btn">button</button>
<label id="textarea"></label>

```

---

```
       var tall = [4, 5, 2, 3, 4, 6, 1, 2, 0, 9, 7, 6, 8, 5, 6, 4, 2, 3, 5]
    var btn = document.getElementById("btn");
    tall.sort(function(a, b){return a-b})
    btn.onclick =  function(){

            for( var i = 0; i < tall.length; i++){
                a = 0;
            for(var j = 0; j<i ; j++){
                a++;
                tall.splice(i, 2)
                document.write("number "+tall[i]+" is "+ a+" times<br>")

            }

        }
    }

```