JSFiddle - React, Tailwind, and code Playground

HTML

<table>
    <tr>
        <td>one</td>
    </tr>
    <tr>
        <td>two</td>
    </tr>
    <tr>
        <td>three</td>
    </tr>
    <tr>
        <td>four</td>
    </tr>
    <tr>
        <td>five</td>
    </tr>
    <tr>
        <td>six</td>
    </tr>
    <tr>
        <td>seven</td>
    </tr>
</table>

JavaScript

var indices = [0,3,4,6];
//What I'd love to do
alert($("tr").eq(indices).length);

//What does work, but feels sloppy & inefficient 
var selector = ""; 
$(indices).each(function(i, index){
    selector += "tr:eq(" + index + ")";
    if(i + 1 != indices.length){
        selector += ","
    }
});

alert($(selector).length);