Post4VPS Forum | Free VPS Provider

Full Version: Removing data from array
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys, i was searching for how to remove data from array in javascript but i got nothing helpfull from google.
here is the array i created
Code:
var Workers = [];
added data in it by
Code:
var p = "dd", age = 55;
Workers.push({"Name": p, "worker-Age": age})
now i want to delete this data by giving Worker age or by worker name, what should i do?
(11-15-2019, 03:32 PM)DecĀ ent12 Wrote: [ -> ](...)
now i want to delete this data by giving Worker age or by worker name, what should i do?

Not sure what you mean by that! But if it is that you're seeking to get the values out of the populated array, then try this:
Code:
> Workers[0].Name;
'dd'
> Workers[0]["worker-Age"];
55

Good luck!
(11-16-2019, 04:51 AM)fChk Wrote: [ -> ]Not sure what you mean by that! But if it is that you're seeking to get the values out of the populated array, then try this:
Code:
> Workers[0].Name;
'dd'
> Workers[0]["worker-Age"];
55

Good luck!
Thanks for your reply but i think i had stated very clearly what i wanted to say but anyways i found the way and i wanted to ask about removing not about fetching data from array.
solution: https://stackoverflow.com/questions/9882...g-for-loop
Thread closed at request of author.