JSFiddle - React, Tailwind, and code Playground

HTML

<table>
    <tr>
        <td>Produto 1</td>
        <td>Valor1</td>
        <td><input type="checkbox" name="" id=""></td>
    </tr>
    <tr>
        <td>Produto 2</td>
        <td>Valor2</td>
        <td><input type="checkbox" name="" id=""></td>
    </tr>
    <tr>
        <td>Produto 3</td>
        <td>Valor3</td>
        <td><input type="checkbox" name="" id=""></td>
    </tr>
</table>

<br><br>
        
<div class="result"></div>

JavaScript

$(document).ready(function(){
    var total = [];
    $("tr").each(function(){
        total.push("");
    });
    
    $("input").click(function(){    
        var index = $(this).closest("tr").index();
        console.log(index);
        if($(this).prop('checked')){
            total[index] = $(this).parent().parent().find("td:first-of-type").text();
            $(".result").html(total);
        } else {
            total[index] = "";    
            $(".result").html(total);        
        }
        console.log(total);
    });
 });