一、背景
使用 console.log 在控制台中打印数组或者对象时,很多时候它们的字段都是默认关闭的,需要手动一个个的点开,非常不直观且麻烦。
二、解决方案
使用 JSON.stringify() 的第三个参数
- 我们来看一下官方对于 JSON.stringify 的介绍
  
 三、示例
const options = [
	{
		label: "数据库类型名称",
		prop: "cnName",
		value: "",
		type: "input",
		filterable: true,
		width: 150
	},
	......
]
console.log('before', options)
console.log('before', JSON.stringify(options, null, 2))
- 打印效果
  
















![[HGAME 2022 week1]Matryoshka(古典密码混合)](https://img-blog.csdnimg.cn/direct/3d828969548b4036893562abc1b0d54f.png)


