我想知道是否可以实现这个功能,如果可以的话,我该如何循环遍历它:
[
{
"name": "Hello",
"views": 10,
"subMovie": [
{
"name": "World",
"views": 10,
"subMovie": [
{
"name": "Test 1",
"views": 10,
"subMovie": [
{
"name": "Test 2",
"views": 10,
"subMovie": [
{
"name": "Test 3",
"views": 10,
"subMovie": [],
"id": 5
}
],
"id": 4
}
],
"id": 3
}
],
"id": 2
}
],
"id": 1
}
]
如何获取最后一个子元素(subMovie)?
我想访问它们并将它们全部打印出来,但是如何在jQuery/JavaScript中循环遍历这个子元素中的子元素呢?