let order = 0 data.map((item, index) => { if (index > 0 && data[index - 1].x2 >= item.x1) { order += 1 } else { order = 0 } }