[Javascript] Advanced Console Log Arguments
2016-05-14 05:32
661 查看
Get more mileage from your console output by going beyond mere string logging - log entire introspectable objects, log multiple items in one call, and apply C-Style string substitution to make the console work for you.
// Can accept multi args console.log("Hello", "World", "2016"); // Hello World 2016 // Can accept any Javascript type console.log({foo: "bar", foobar: {bar: "foo"}}); // Substitution console.log("Hello my name is %s, %d years age, object ->", "Zhentian", 23, {name: "Zhentian"}); // Hello my name is Zhentian, 23 years age, object -> Object {name: "Zhentian"} // Styling output console.log("Listen, this is %cimportant!", "font-size: 24px; color: red");
相关文章推荐
- [Javascript] Log Levels and Semantic Methods
- 高性能的JavaScript库---Lodash
- 中国天气网接口返回json格式分析及接口(XML、图片接口)说明!
- Json 和 Jsonlib 的使用
- json-lib.jar开发包及依赖包的下载地址
- javascript中的那些让人摸不着头脑的不=
- JSP EL表达式使用
- jstl标签库
- 下拉菜单 JavaScript
- JS 处理Json 时间带T 时间格式
- js清空array数组的方法
- js类型转换,运算符,语句
- Json介绍及Jsoncpp简单使用(测试代码+测试实例)
- JSON.stringify()、eval(),JSON.parse()各自的区别于作用
- JS学习1简介
- **解析JSON对象与字符串之间的相互转换
- mac下使用sencha cmd+extjs6
- JSON.parse() 与 eval()
- js实用文档
- reponse对象JSP学习