温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

console.log怎么在console窗口输出信息

发布时间:2022-03-09 10:37:10 来源:亿速云 阅读:421 作者:iii 栏目:开发技术

这篇文章主要介绍“console.log怎么在console窗口输出信息”,在日常操作中,相信很多人在console.log怎么在console窗口输出信息问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”console.log怎么在console窗口输出信息”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

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

Global

属性

  • NaN

  • Infinity

  • undefined

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

方法

  • parseInt

  • parseFloat

  • isNaN

  • isFinite

  • decodeURI

  • decodeURIComponent

  • encodeURI

  • encodeURIComponent

到此,关于“console.log怎么在console窗口输出信息”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI