0

I am encountering a weird bug in my codepen demo at here, this console.log do not undergo any sort of loop. When **console.log(horiresolveOverlaps(result[0]) is commented or uncommented which means not run or run by the program, it strangely gives 2 different output for results[0]***. This should not have happened because you have to run results[0] first before even proceeding to hori_*resolve_overlaps line. The correct output should be 40 :)

This means the problem is at hori_resolveOverlaps() in my demo, it has this slice functionality which I guess is the main issue. I am unsure on how to resolve this issue, any help will be very much appreciated :)

Scenario 1

console.log(result[0]);

enter image description here

Scenario 2

console.log(result[0]);
console.log(hori_resolveOverlaps(result[0]) )

enter image description here

lines.slice(1).forEach((line) => {

I am not sure whether this slice function is the main issue

0 Answers0