I'm trying to fill a new array within a loop, but I can't figure it out.
What I need is, that I filter all value's from my temporary array to set to my new array. all value's that start with "+" need to get into the array "my_hash_plus". this is what I have now.
var my_hash_plus = new Array;
$.each(my_hash_plus_tmp, function(_, temp) {
if (tmp[0] == "+") {
my_hash_plus[] = temp;
}
});
I noticed that I can't fill my array with [] in js, but if I those things then my_hash_plus becomes a normal var... So my question is: what is the best way to get all the value's from the array my_hash_plus_tmp that start with "+" into a new array (which I will call my_hash_plus)