arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Removing data from array
#1
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
var Workers = [];
added data in it by
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?
#2
(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:
> Workers[0].Name;
'dd'
> Workers[0]["worker-Age"];
55

Good luck!
VirMach's Buffalo_VPS-9 Holder (Dec. 20 - July 21)
microLXC's Container Holder (july 20 - ?)
VirMach's Phoenix_VPS-9 Holder (Apr. 20 - June 20)
NanoKVM's NAT-VPS Holder (jan. 20 - ?)
#3
(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:
> 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
#4
Thread closed at request of author.
Terminal
Thank you to Post4VPS and VirMach for my awesome VPS 9!  
lockThread Closed 


person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting