• Math的方法;Date的方法;


    Math的方法:

    (1)弧度的π  Math.PI()

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

    (3)返回x的绝对值 Mathabs(x)

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

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

    (6)返回其中的最大值 Math.max(a,b,c,d)

    (7)返回其中的最小值 Math.min(a,b,c,d)

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

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

    (10)返回x的正弦值 Math.sin(x)

    (11)返回x的余弦值 Math.cos(x)

    (12)返回x的正切值  Math.tan(x)

    (13)返回x的反正弦值 Math.asin(x)

    (14)返回x的反余弦值 Math.acos(x)

    (15)返回x的反正切值  Math.atan(x)

    Date的方法:

    有两个系列:get 、set    

    Date是类,使用时要用关键字new

      get系列:

    (1)getDate()返回事件对象的某一天

    (2)getDay()返回一周中的某天0-6

    (3)getFullYear()返回四个数字的年份

    (4)getMonth()返回月份 0-11

    (5)getHours()返回小时0-23

    (6)getSeconds()返回秒 0-59

    (7)getTime()获取1970年至今的毫秒数

    (8)getMInutes()返回分钟0-59

    (9)getMiliseconds()返回毫秒

    (10)parse()返回指定时间到1970年1月1日的毫秒数

      var s=Date.parse("12 14,2018")

      set系列

    (1)setDate()设置事件对象的某一天

    (2)setFullYear()设置年份

    (3)setMonth()设置月份

    (4)setHours()设置小时

    (5)setMinutes()设置分钟

    (6)setSeconds()设置秒数

  • 相关阅读:
    JavaScript高度和宽度详解
    VC6程序图标
    VC++中的Dlg,App,Doc,view
    Vista桌面图标无法拖动
    VC2008中IE8脚本错误问题解决
    单文件安装包制作(转)
    AutoResetEvent与ManualResetEvent区别
    纯JavaScript中调用WebServices
    动态加载程序集Assembly.Load
    VC++小知识积累
  • 原文地址:https://www.cnblogs.com/qinlinkun/p/10139303.html
Copyright © 2020-2023  润新知