How can I store the value of the arrays to an individual variable

I have this code of mine wherein before I store the values of my array, they are first sorted and filtered to the the nearest value of the user input by 5 data points. Here is my code:enter image description here

I tried storing them from the console.log(findClosest) command but it doesn’t seem to work