From: sto.mar@... Date: 2013-07-10T00:19:03+09:00 Subject: Re: create variables depending on counter Am 09.07.2013 17:13, schrieb stefan heinrich: > Hi community, > > First of all sorry for my english and I hope you get what I want to say. > As an example let us say I have an Array like this: > > Car > Dog > Car > Car > Dog > > What i want to do is I want to collect all Cars in a new Array and all > Dogs in a new Array, too. > So I need two new Arrays to do this. With Array.uniq.length I get the > number of my new Arrays I need. > Is there a way to implement this that the programme counts the uniq > elements in the array and creates variables depending on the counter. > > So difficult to explain. I hope anyone can help me. I do not understand completely. What should the two new arrays look like? ['Dog', 'Dog'], ['Car', 'Car', 'Car'] ??? Doesn't make too much sense to me... Regards, Marcus --