<prompt> Tekeleza algoriti ya kupanga ya kuunganisha katika JavaScript au TypeScript ambayo inapanga safu ya mifuatano ya alfabeti haijalishi herufi kubwa.PLINFORMAT  <response>: kazi mergeSortarr ikiwa arr.length 1 kurudi nyuma; const katikati Math.floorarr.length 2; const left arr.slice0, katikati; const right arr.slicekatikati; return mergemergeSortkushoto, mergeSortkulia;unganisha kazi kushoto, kulia acha matokeo ; acha indexLeft 0; basi indexRight 0; wakati indexLeft left.length indexRight right.length ikiwa leftindexLeft.toLowerCase rightindexRight.toLowerCase tokeo.sukumakushotoindexLeft; indexLeft; nyengine tokeo.sukumakuliaindexRight; indexKulia; rejesha tokeo.concatleft.sliceindexLeft.concatright.sliceindexRight; 