My idea is quite complex, because I want to create something similar to { id: 1, Rok: 1, Cena: chart1, cena2: chart2 }, to have date to use in tabulator. I thought that I can create by loop for. I take props from parent, which want to use as a date.
function Table ({chart1, chart2}){
const Data = [index, rok, data1, data2 ]
const data1 = [];
const data2 = [];
const index = [];
const rok = [];
for(i = 0; i< 25; i++) {
data1.push(chart1[i]);
data2.push(chart2[i]);
rok.push(`rok + ${i}`);
index.push(i);
}
but the result of the operation will be look like
[ [1,2,3,4,5,6..], [rok1, rok2, rok3....], [], [] ]
then I thought about something differ, but do not work as well:
function Table ({chart1, chart2}){
const Data = [];
for(i=0; i<25; i++){
Data.push(
`{`"rok": + "rok" i + "id:" + i + "cena1:" + chart1[I] + "cena2": chart2[I]`}` );
}
()}