JS Common API (array maximum and minimum value)

Source: Internet
Author: User
  1. Array class
    var arr=[1,5,76,433,34,34];//array max function Maxarr (arr) {return Math.max.apply (null, arr);} Array minimum function Minarr (arr) {return Math.min.apply (null, arr);} Maxarr (arr);//1
  2. Random number
        Generates an integer var    ran=parseint (Math.random () * (max-min+1) +min)    //generated random number [Min,max] for the integer    vars 0,max parseint (Math.random () * (max+1))
  3. Date Time Class
            24 hours to 12 hours        h>12&& (h-=12);        <10 Digital complement 0        s<10&& ("0" +s);    
  4. Angle
            Angle conversion to radians        function rad (deg) {            return deg*math.pi/180        }        //radians to angular        function deg (RAD) {            Return 180*rad/math.pi        }    

JS Common API (array maximum and minimum value)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.