我有數據的字符串,是x的字符串,y對這樣的:查找最大/最小的數據串
[
[0.519999980926514, 0.0900000035762787],
[0.529999971389771, 0.689999997615814],
[0.519999980926514, 2.25],
[0.850000023841858, 2.96000003814697],
[1.70000004768372, 3.13000011444092],
[1.91999995708466, 3.33999991416931],
[0.839999973773956, 3.5],
[1.57000005245209, 3.38000011444092],
[0.819999992847443, 3.00999999046326],
[1.69000005722046, 2.99000000953674],
[2.98000001907349, 3.23000001907349],
[0.509999990463257, 1.11000001430511],
[0.670000016689301, 1.35000002384186],
[0.660000026226044, 1.26999998092651],
[0.689999997615814, 0.0500000007450581],
[1.30999994277954, 0.0599999986588955],
[0.569999992847443, 0.0299999993294477],
[0.629999995231628, 0.0399999991059303],
[0.720000028610229, 0.0399999991059303],
[0.639999985694885, 0.0399999991059303],
[0.540000021457672, 0.0399999991059303],
[0.550000011920929, 0.0500000007450581],
[0.850000023841858, 0.0399999991059303],
[0.610000014305115, 0.0199999995529652],
[0.509999990463257, 0.0500000007450581],
[0.610000014305115, 0.0599999986588955],
[0.5, 0.0599999986588955],
[0.639999985694885, 0.0599999986588955]
]
我想要做的就是找到每對中的最大值和最小值。
有沒有辦法做到這一點,而不通過整個字符串,並檢查對中的每個元素?
你嘗試過什麼嗎?你能告訴我們一些代碼嗎?這可能是一個重複的http://stackoverflow.com/questions/1379553/how-might-i-find-the-largest-number-contained-in-a-javascript-array –
你是什麼意思最小最大在每一雙?你能打印樣本輸出嗎?對於你的問題,我認爲你可以從小問題開始。 – Mutant
不,如果不通過每個字符串並單獨比較它們,沒有辦法做到這一點,除非您通過另一個函數獲取此信息,您可以在保存數組之前對其進行比較。 – Deviljho