• two methods merge and mergesort
  • mergesort will be called recursively
  • keep dividing sub list till only one element is left
  • two pointer applied to merge two sorted arrays
  • merge methods merges two sorted arrays
  • mergeSort recusive function with base case where are length less than 1 return array
  • this is different find of recursion where one function calls the other
  • the mergeSort function slices array in two halves and passes left and right subarray to merge function
  • https://rajat-m.medium.com/implement-5-sorting-algorithms-using-javascript-63c5a917e811