Compare multidimensional arrays from diferent files. Automatically send results to AI generated image [closed]

I have an html questionnaire with 6 questions and each question can be answered with 1, 2 or 3.

I have a file gv18.js (in javascript with 18 multidimensional arrays divided into 6 senses, with 3 sensations for each).

I have a file w100.js (in javascript with 100 multidimensional arrays and each one has a name corresponding to a word).

I want to implement an algorithm as follows:
If the user chooses the radio button “1” in the questionnaire at question I, all sub-arrays from multidimensional arrays COLD from gv18.js; If the user chooses the radio button “2” in the questionnaire at question I, all sub-arrays from multidimensional arrays MTO (from mixed touch) from gv18.js are kept. If the user chooses the radio button “3” in the questionnaire at question I, all sub-arrays from multidimensional arrays HOT from gv18.js are kept. The logic follows for all questions.

All files are at: https://mindgraphy.eu/SYS10. Respectively gv18.js and w100.js

Compare the resulting multidimensional array that will be kept with all arrays in w100.js. Find the 5 names of the closest arrays.

I want these 5 names of the closest arrays to be sent to: https://deepai.org/ with the request to generate an image. For this I press the FIND button.

When I press another SHOW button on the html page, the image appears.