Basically, I know how to sort date in array, so I know that it is possible to compare it. But my question is more complex. I have two array and in some cases it can be that one cross each other, and in some it doesn't My question is how to write dynamic analytic info under this chart in case it cross each other, and in case it does not.
useMemo(() => {
for(var i = 0; i<25; i++){
if(datasetone[I]>datasetwo[i]){return setText(true)}
if(datasetone[i]< datasetwo[i]) {return setText(false);
setRoznica(datasetone[24] - datasetwo[24]);
}
}
}, [datasetone, datasetwo]);
because I know that situation on chart that one is higher then another can happen just one, I want loop through all element of dataset and in case one is higher write statement.
and second quastion is WHEN it happen, you know .flirt or .find which index of dataset is moment of being higher then second one.
This is important because people in my country do not know how to analytic a chart so I can write statement if something happen to tell them.