tencent cloud

腾讯云超级应用服务

基础类库

Download
聚焦模式
字号
最后更新时间: 2024-07-12 16:53:05

1. console

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

2. 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 标准。

3. 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(){})));


4. Number

属性

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

5. Date

属性

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

6. Global

属性

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

方法

parseInt
parseFloat
isNaN
isFinite
decodeURI
decodeURIComponent
encodeURI
encodeURIComponent
以上方法的具体使用请参考 ES5 标准。





帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈