function getPaliersTable(tableId){ let table = []; $(`#${tableId} tr`).has('td').each(function () { var arrayItem = {}; $('td', $(this)).each(function (index, item) { if (index < 4){ let val = parseFloat($(item).html()) arrayItem[index] = !isNaN(val) ? val : null; } }); table.push(arrayItem); }); return table }