如何在控制台上打印它 [英] How to print it on console

查看:123
本文介绍了如何在控制台上打印它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[name:Y,

name:ravi,

totalRecords:30,

详细信息:[

{

信息:kumar1,

数字:123,

otherDetails:{

条目:[

{

class:class2,
class:class3

},

{

key:key2,

value:value2

},

{

key:key1,

value:value1

}

]

}

},

{

信息:kumar1,

数字:123,

otherDetails:{

条目:[

{

class:class2,

class:class3

},

{

key:key2,

值:value2

},

{

key:key1,

值:value1

}

]

}

}

]

}

]



我尝试了什么: <每个(数据,函数(键,值){
console.log(key =+ key +value)


 $。 =+值); 
$ .each(value,function(key1,value1){
console.log(key1 =+ key1 +value1 =+ value1);
$ .each(value1,function (key2,value2){
console.log(key2 =+ key2 +value2 =+ value2);
});
});


});

解决方案

.each(数据,函数(键,值) {
console.log(key =+ key +value =+ value);


.each(value,function(key1,value1){
console.log(key1 =+ key1 +value1 =+ value1);


.each(value1,function(key2,value2){
console.log( key2 =+ key2 +value2 =+ value2);
});
});


});


[ "name": "Y",
"name": "ravi",
"totalRecords": 30,
"Details": [
{
"Info": "kumar1",
"Number": "123",
"otherDetails": {
"entry": [
{
"class": "class2",
"class": "class3"
},
{
"key": "key2",
"value": "value2"
},
{
"key": "key1",
"value": "value1"
}
]
}
},
{
"Info": "kumar1",
"Number": "123",
"otherDetails": {
"entry": [
{
"class": "class2",
"class": "class3"
},
{
"key": "key2",
"value": "value2"
},
{
"key": "key1",
"value": "value1"
}
]
}
}
]
}
]

What I have tried:

$.each(data,function(key,value){
					 console.log("key = "+key+" value= "+value);
					 $.each(value,function(key1,value1){
							 console.log("key1 = "+key1+" value1= "+value1);
							 $.each(value1,function(key2,value2){
								 console.log("key2 = "+key2+" value2= "+value2);
								}); 
							}); 
							 
					 
				});

解决方案

.each(data,function(key,value){ console.log("key = "+key+" value= "+value);


.each(value,function(key1,value1){ console.log("key1 = "+key1+" value1= "+value1);


.each(value1,function(key2,value2){ console.log("key2 = "+key2+" value2= "+value2); }); }); });


这篇关于如何在控制台上打印它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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