2018/12.21:找出数组最大项和最小项。

找出数组中的最大项和最小项

1.借助math中max

  math.max.apply(null,a) 返回值就是最大值

2.借助数组中的sort()

2.借助数组中的 sort()

3.假设法

对数组排序方法

1.借助array中的sort(function(a,b){return a-b})

2.冒泡排序

二分查找

Math 数值对象

js自带的类 array number string function date math regexp boolean

Math类 math对象 又研究一堆的属性方法

数学中的弧度和角度

1.弧度的 Π Math.Pi

2.返回平方根 Math.sqrt(16)

3.Math.abs(x)返回的绝对值

4.Math.ceil(x) 返回x的上舍入

5.Math.floor(x)返回x的下舍入

6.Math.max(a,b,c,d)返回a,b,c,d中最大值必须是数字

7.Math.min(a,b,c,d)返回a,b,c,d最小值必须是数字

8.Math.random()返回0-1之间的随机数

9.Math.round(x)返回对四舍五入后的数值

10.Math.sin(x) 返回x的正弦值 对边比斜边

11.Math.cos(x) 返回x的余弦值 ;邻边比斜边

12. Math.tan(x) 返回x的正切值 对边/邻边

 

posted @ 2018-12-21 15:38  晋飞翔  阅读(354)  评论(0编辑  收藏  举报