,
報(bào)錯(cuò)信息
產(chǎn)生這種的錯(cuò)誤大致有兩種情況:
1.json格式數(shù)據(jù)存在循環(huán)調(diào)用皇钞。
Example:
????const obj = {
????????age: '16'
????}
????obj.name = obj;
????JSON.stringify(obj);?
2.數(shù)據(jù)嵌套復(fù)雜的數(shù)據(jù)類型蛇数。
Example:
????const arr = [
? ? {
? ? ? ? age: '10',
? ? ? ? name: '鏟屎官1',
? ? ? ? obj: {...}? ? // 這里的嵌套會(huì)導(dǎo)致報(bào)錯(cuò)
????},
????{
????????age: '12',
????????name: '鏟屎官2'
????}
]
JSON.stringify(arr);?