{content:[Circular]}在JavaScript中意味着什么? [英] What does { content: [Circular] } mean in JavaScript?

查看:122
本文介绍了{content:[Circular]}在JavaScript中意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码是:

var chineseBox = {};
chineseBox.content = chineseBox;

并返回:

{ content: [Circular] }

这是什么意思?

推荐答案

您的对象包含循环参考。如果您尝试打印(或序列化)此对象,您将最终处于无限循环中

Your object contains a circular reference. If you tried to print (or serialize) this object you would end up in an infinite loop

{content: {content: {content ...

相反,您的系统足够聪明,可以注意到循环并保护自己不受其影响。

Instead, your system was smart enough to notice the circularity and protect itself against it.

这篇关于{content:[Circular]}在JavaScript中意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆