javascript - 如何理解Math.max.apply(null,a)中的null
本文介绍了javascript - 如何理解Math.max.apply(null,a)中的null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
a=[10,20,30]
alert(Math.max(10,20,30))
alert(Math.max.apply(null,a))
可以理解这里为什么要用apply,是为了让math.max可以处理数组,但是不能理解Null是什么意思?
解决方案
看看snandy的解释:http://www.cnblogs.com/snandy...
这篇关于javascript - 如何理解Math.max.apply(null,a)中的null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文