zoukankan      html  css  js  c++  java
  • 小程序基础类库

    console

    console.log 方法用于在 console 窗口输出信息。它可以接受多个参数,将它们的结果连接起来输出。

    Math

    属性

    • E
    • LN10
    • LN2
    • LOG2E
    • LOG10E
    • PI
    • SQRT1_2
    • SQRT2

    以上属性的具体使用请参考 ES5 标准。

    方法

    • abs
    • acos
    • asin
    • atan
    • atan2
    • ceil
    • cos
    • exp
    • floor
    • log
    • max
    • min
    • pow
    • random
    • round
    • sin
    • sqrt
    • tan

    以上方法的具体使用请参考 ES5 标准。

    JSON

    方法

    • stringify(object): 将 object 对象转换为 JSON 字符串,并返回该字符串。
    • parse(string): 将 JSON 字符串转化成对象,并返回该对象。

    示例代码:

    
    console.log(undefined === JSON.stringify());
    console.log(undefined === JSON.stringify(undefined));
    console.log("null"===JSON.stringify(null));
    
    console.log("111"===JSON.stringify(111));
    console.log('"111"'===JSON.stringify("111"));
    console.log("true"===JSON.stringify(true));
    console.log(undefined===JSON.stringify(function(){}));
    
    
    console.log(undefined===JSON.parse(JSON.stringify()));
    console.log(undefined===JSON.parse(JSON.stringify(undefined)));
    console.log(null===JSON.parse(JSON.stringify(null)));
    
    console.log(111===JSON.parse(JSON.stringify(111)));
    console.log("111"===JSON.parse(JSON.stringify("111")));
    console.log(true===JSON.parse(JSON.stringify(true)));
    
    console.log(undefined===JSON.parse(JSON.stringify(function(){})));
    

    Number

    属性

    • MAX_VALUE
    • MIN_VALUE
    • NEGATIVE_INFINITY
    • POSITIVE_INFINITY

    以上属性的具体使用请参考 ES5 标准。

    Date

    属性

    • parse
    • UTC
    • now

    以上属性的具体使用请参考 ES5 标准。

    Global

    属性

    • NaN
    • Infinity
    • undefined

    以上属性的具体使用请参考 ES5 标准。

    方法

    • parseInt
    • parseFloat
    • isNaN
    • isFinite
    • decodeURI
    • decodeURIComponent
    • encodeURI
    • encodeURIComponent

    以上方法的具体使用请参考 ES5 标准。

  • 相关阅读:
    C/S 架构和B/S架构的区别
    LoadRunner工作原理
    修改密码测试用例
    登录测试用例
    上传测试点
    avd 配置信息详解
    创建模拟器
    命令模式下启动模拟器,加载软件
    启动模拟器时出现Failed to create Context 0x3005
    SDK Manager更新时出现Failed to fectch URl https://dl-ssl.google.com/android/repository/addons_list.xml, reason: Connection to https://dl-ssl.google.com ref
  • 原文地址:https://www.cnblogs.com/zmdComeOn/p/9686077.html
Copyright © 2011-2022 走看看