zoukankan      html  css  js  c++  java
  • Math.min() Math.max() Math.min().apply() Math.max() .apply()该如何使用???

    Math.min()和 Math.max() 

    语法:

    Math.min(x,y)
    Math.max(x,y)

    虽然能取到最小值和最大值,但是不支持数组。

    那么如何计算数组中的大小值呢?????????????????????

    Math.min().apply()  和   Math.max() .apply()

    语法:

    Math.min.apply(obj,args);

    Math.max.apply(obj,args);

    第一个参数obj对象将代替Function类里this对象,第二个参数是数组

    可以书写为

    Math.max.apply(this,args);

    Math.max.apply(null,args);

  • 相关阅读:
    apns libcurl
    apns libcurl
    epoll
    epoll
    Linux服务器压测
    Linux服务器压测
    libevent
    libevent
    shell脚本
    shell脚本
  • 原文地址:https://www.cnblogs.com/snowbxb/p/11396020.html
Copyright © 2011-2022 走看看