Delete object property, change length?

R

Ryura

Hello,
I'm currently getting some JSON data (y.x) and then doing something
like this:
$("dd.tajauser").each(function() { // does the function for each
dd.tajauser
var z=y.x.length;
z-=1;
do {
if (y.x[z].a == b) {
c[d]+=parseInt(y.x[z].e);
delete y.x[z];
};
}
while (z--);
});
My problem is this: delete doesn't affect y.x.length, so when my each
function attempts to check the second dd.tajauser, I get thrown this
error
y.x[z] has no properties

How can I delete y.x[z] and modify the length of y.x at the same time?
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top