在js中查找非数字最小值

时间:2017-06-22 04:54:25

标签: javascript

我想在JS中获得最小数组或可迭代数。这些项目不一定是数字。

据我所知,内置 Weight Volume den higher lower between howhigh 1 5.1626 5.1594 1 0 0 0 0 2 5.1615 5.1559 0 0 0 0 0 3 5.1600 5.1574 1 0 0 0 0 4 5.1593 5.1582 0 0 0 0 0 5 5.1592 5.1572 0 0 0 0 0 6 5.1635 5.1580 1 0 0 0 0 7 5.1608 5.1580 0 0 0 0 0 8 5.1602 4.0565 0 0 0 0 0 9 5.1582 5.1554 0 0 0 0 0 10 5.1563 5.1547 0 0 0 0 0 11 5.1578 5.1550 1 0 0 0 0 12 5.1589 5.1560 0 0 0 0 0 13 5.1578 3.1553 0 0 0 0 0 14 5.1591 5.1554 1 0 0 0 0 15 5.1585 5.1563 0 0 0 0 0 16 5.1572 5.1557 0 0 0 0 0 17 5.1565 5.1520 0 0 0 0 0 18 5.2240 5.1518 0 0 0 0 0 19 5.1540 5.1505 1 0 0 0 0 20 5.1539 5.1488 0 0 0 0 0 21 5.1520 5.1408 0 0 0 0 0 22 5.1450 5.1420 0 0 0 0 0 23 5.1455 5.1420 0 0 0 0 0 24 5.1461 5.1435 0 0 0 0 0 25 5.1470 5.1437 0 0 0 0 0 26 5.1449 5.1378 0 0 0 0 0 27 5.1423 5.1385 0 0 0 0 0 28 6.1429 5.1401 0 0 0 0 0 29 5.1425 5.1399 0 0 0 0 0 30 5.1433 5.1403 1 0 0 0 0 没有提供指定比较器功能的能力。

是否有其他内置或标准方法可以完成此(常见)任务?

例如,一个JS类似于Python的 Weight Volume den higher lower between howhigh 1 5.1626 5.1594 1 1 0 5 0.0009 2 5.1615 5.1559 0 0 0 0 0 3 5.1600 5.1574 1 1 0 3 0.0035 4 5.1593 5.1582 0 0 0 0 0 5 5.1592 5.1572 0 0 0 0 0 6 5.1635 5.1580 1 0 1 2 0 7 5.1608 5.1580 0 0 0 0 0 8 5.1602 4.0565 0 0 0 0 0 9 5.1582 5.1554 0 0 0 0 0 10 5.1563 5.1547 0 0 0 0 0 11 5.1578 5.1550 1 0 1 2 0 12 5.1589 5.1560 0 0 0 0 0 13 5.1578 3.1553 0 0 0 0 0 14 5.1591 5.1554 1 1 0 4 0.0649 15 5.1585 5.1563 0 0 0 0 0 16 5.1572 5.1557 0 0 0 0 0 17 5.1565 5.1520 0 0 0 0 0 18 5.2240 5.1518 0 0 0 0 0 19 5.1540 5.1505 1 1 0 9 0.9889 20 5.1539 5.1488 0 0 0 0 0 21 5.1520 5.1408 0 0 0 0 0 22 5.1450 5.1420 0 0 0 0 0 23 5.1455 5.1420 0 0 0 0 0 24 5.1461 5.1435 0 0 0 0 0 25 5.1470 5.1437 0 0 0 0 0 26 5.1449 5.1378 0 0 0 0 0 27 5.1423 5.1385 0 0 0 0 0 28 6.1429 5.1401 0 0 0 0 0 29 5.1425 5.1399 0 0 0 0 0 30 5.1433 5.1403 1 0 0 0 0 接受Math.min函数或Java min接受key。< / p>

到目前为止,我最好的方法是

Collections.min

0 个答案:

没有答案