Hi Programmers ,

How could I compare two arrays which is greater I need to find which array is greater . (Js)

Eg :-

array_1 =["> 90", “< 60”, “>= 50”]

array_2 =["> 70", “< 50”, “>= 30”]

array_3 =["= 50"]

array_4 =["> 70", “>= 30”]

Hi Programmers ,

How could I compare two arrays which is greater I need to find which array is greater . (Js)

Eg :-

array_1 =["> 90", “< 60”, “>= 50”]

array_2 =["> 70", “< 50”, “>= 30”]

array_3 =["= 50"]

array_4 =["> 70", “>= 30”]

Hi, to be honest I do not understand your question.

If you want to compare the lengths of the array, just compare with array.length.

If you want to compare inner content of the array, then explain exactly what should happen? What the final result you want to expect?

In Here Array_1 is greater than array Two

array_1 = ["= 70"] ==> array_1 = 70

array_2 = ["= 50"] ==> array_2 = 50

array_1 = ["< 80" , “> 70”] ==> 80 < array_1 > 70

array_2 = ["> 40" , “<=20”] ==> 20 <= array_2 > 40

So is there any possible way to find which is greater as first example above. Hope you understand my question

Yup my decision rely on that only is there any possible way to find it

Thanks @camperextraordinaire I will get back to you I am also little bit confuse on it , Anyway Thanks for your effort

Guys,

Please visit RoboGuru, coding tool Website for applied coding challenges, puzzles and games. Try to download get a copy of yours in quick 2 minutes. Participate in global competitions.