https://javascript.ruanyifeng.com/stdlib/console.html
console.log方法支持以下几种占位符
%s 字符串
%d 整数
%i 整数
%f 浮点数
%o 对象的链接
%c CSS 格式字符串
在Node.js中测试:
1 2 3 4 5 6
| console.log('%s', 'string') console.log('%d', 123) console.log('%i', 321) console.log('%f', 123.321) console.log('obj is %o', { name: '123' }) console.log('%cThis text is styled', 'color: red; background: yellow; font-size: 24px;')
|

%o可以使对象自动上色,而%c不起效果。
在浏览器中测试:
