Maximum call stack size exceeded error with merge sort function

It’s a global variable containing the unsorted values.