Jump to content

[SOLVED] How to remove certain array elments and put them in a new array?


galvin

Recommended Posts

If you have this array...

 


var animals = new Array("cat*","dog*","monkey","whale*","emu","llama*")

 

....How can you make a new array of ONLY the elements in the first array that end in an asterisk?  So the new array would be..

 

("cat*","dog*","whale*","llama*")

 

Again, how do you extract just the ones that end in an asterisk and put them in a new array?

Thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.