circumvent ERROR Converting circular structure to JSON when doing JSON.stringify()?

前端 未结 4 714
予麋鹿
予麋鹿 2020-12-06 02:03

For debugging I want to serialize javascript objects with JSON.stringify(myobject). But this gives:

TypeError: Converting circular structure to JSON
<         


        
4条回答
  •  无人及你
    2020-12-06 02:23

    You can use console.log() and the chrome javascript debug console, which will happily let you inspect your object even if it has cyclic references.

提交回复
热议问题