<prompt> Tengeneza chaguo la kukokotoa la JavaScript ambalo huchukua safu ya vitu vinavyowakilisha matukio na nyakati za kuanza na kuisha katika umbizo la muhuri wa muda wa Unix na kurudisha safu mpya iliyo na matukio yasiyoingiliana tu yaliyopangwa kulingana na wakati wao wa kuanza. Iwapo kuna matukio yanayopishana, weka tukio kipaumbele kwa wakati wa mwanzo wa kuanza.PLINFORMAT  <response>: kazi removeOverlappingEventsmatukio Panga matukio kwa wakati wa kuanza matukio.pangaa, b a.anza - b.anza; let nonOverlappingEvents ; kwa wacha i 0; i events.length; i let currentEvent matukioi; let isOverlapping uongo; Angalia ikiwa tukio la sasa linapishana na matukio yoyote yasiyoingiliana kwa acha j 0; j nonOverlappingEvents.length; j let previousEvent nonOverlappingEventsj; kama currentEvent.start previousEvent.start currentEvent.start previousEvent.end currentEvent.end previousEvent.start currentEvent.end previousEvent.end isOverlapping kweli; mapumziko; Ikiwa tukio la sasa haliingiliani na matukio yoyote yasiyoingiliana, liongeze kwenye safu ya matokeo. ikiwa !isOverlapping nonOverlappingEvents.pushcurrentEvent; rudisha nonOverlappingEvents; 