[英]I am not able to understand the code
I am new to javascript.我是 javascript 新手。 After lots of hours I am not able to understand the code.
很多小时后,我无法理解代码。 I would be grateful if someone could help me.
如果有人可以帮助我,我将不胜感激。 Thanks
谢谢
for(var x = 0; x < id_inters['inters'].length; x++) {
var a,b;
if(id_inters['inters'][x]['First_ID'] == data.main[0].cust) {
a = id_inters['inters'][x]['First_ID'];
b = id_inters['inters'][x]['Second_ID2'];
You can take it with these steps from the for loop:您可以从 for 循环中执行以下步骤:
id_inters
which hold an array named inters
which also holds objects in it.id_inters
持有数组名为inters
也拥有它的对象。var a, b;
var a, b;
. id_inters['inters'][x]['First_Id']
where x
is the index number if each iteration which is incremented from 0 to length of array.id_inters['inters'][x]['First_Id']
检查迭代对象的值,其中x
是索引号,如果每次迭代从 0 增加到数组长度。data['main'][0].cust
.data['main'][0].cust
的第一个值。 Where data is an object which contains an array named data and you are comparing its first object's cust value.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.