<prompt> Andika chaguo la kukokotoa la JavaScript ambalo huchukua safu mbili kama ingizo na kurudisha safu mpya iliyo na makutano ya safu mbili za ingizo yaani, vipengele vya kawaida kwa safu zote mbili. Chaguo za kukokotoa zinapaswa kufanya kazi na safu za aina yoyote ya data na sio kurekebisha safu asili. Zaidi ya hayo, andika vipimo vya kitengo cha chaguo za kukokotoa kwa kutumia mfumo wa upimaji wa Jest.  <response>: Hapa kuna kazi ya JavaScript ambayo hupata makutano ya safu mbili: javascriptkazi arrayIntersectionarr1, arr2 ikiwa !Array.isArrayarr1 !Array.isArrayarr2 kutupa Hitilafu mpya Ingizo zote mbili lazima ziwe safu.; const result arr1.filterelement arr2.includeselement; kurudi ...new Setmatokeo;Na hapa kuna vipimo vya kitengo kwa kutumia mfumo wa upimaji wa Jest: javascriptconst arrayIntersection need.arrayIntersection;explainarrayIntersection, testinarudisha makutano ya safu mbili zilizo na vitu vya kawaida, expectarrayIntersection1, 2, 3, 2, 3, 4.toEqual2, 3; expectarrayIntersectiona, b, c, b, c, dtoEqual b, c, ; ; testinarudisha safu tupu wakati hakuna vitu vya kawaida, expectarrayIntersection1, 2, 3, 4, 5, 6.toEqual; expectarrayIntersectiona, b, c, d, e, f.toEqual; ; testhaibadilishi safu asili, const arr1 1, 2, 3; const arr2 2, 3, 4; arrayIntersectionarr1, arr2; expectarr1.toEqual1, 2, 3; expectarr2.toEqual2, 3, 4; ; testinafanya kazi na safu zilizo na aina tofauti za data, tarajia makutano ya safu 1, mbili, tatu: 3, moja, 2, tatu: 3, mbili .toEqualmbili; ; testhutupa kosa wakati pembejeo sio safu, expect arrayIntersectionsio safu, 1, 2, 3.toThrow Ingizo zote mbili lazima ziwe safu. ; expect arrayIntersection1, 2, 3, sio safu.toThrow Ingizo zote mbili lazima ziwe safu. ; ;;Hakikisha umehifadhi chaguo hili la kukokotoa katika faili iitwayo arrayIntersection.js na majaribio katika faili iitwayo arrayIntersection.test.js. Ili kufanya majaribio, hakikisha kuwa umesakinisha Jest npm install --save-dev jest na uendeshe jest au npm test kwenye terminal yako. 