程序框架管理之基础类库

网友投稿 204 2024-07-07

基础类库

#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

#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标准。


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:小程序框架之FXS 语言数据类型
下一篇:小程序API基础说明
相关文章

 发表评论

暂时没有评论,来抢沙发吧~