By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,098 Members | 1,893 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,098 IT Pros & Developers. It's quick & easy.

Delete object property, change length?

P: n/a
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.
Jan 23 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
VK
On Jan 24, 2:03 am, Ryura <yoyobo...@gmail.comwrote:
How can I delete y.x[z] and modify the length of y.x at the same time?
http://developer.mozilla.org/en/docs...s:Array:splice
Jan 23 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.