javascript : if in my function wont work and my function wont call values from array [closed]

javascript : if in my function wont work and my function wont call values from array

enter image description here
this is my code and i point out where is the problem

i made a function that would check largest element in the temperatures array then take the max and min value after that it should subtract min from max but the for part in the function has problem its seems temps.length considered as single string since both temps and length has the same color