[RESOLVED] Array Loop problem
Hi,
I am recently working with an application. Where I need 4 unique values from an array in such a way that it should checking random item every time.
For eg:-
Main_Array = ["one","two","three","four","five","six","seven "];
Sub_Array = ["three"]; // initially it holds one value
for(each value of Sub_Array)
{
if(Sub_Array[value] == Main_Array[RandomNumber])
{
// It should get another random item from Main_Arr and check
}
else
{
Sub_Array.push(Main_Array[RandomNumber]);
//next time updated Sub_Arrays values should be checked.
}
}
// I want an array with 3 unique values other then the one already pushed in
Sub_Array
I am trying but I don't get unique values, or something gets wrong which I am not able to solve. Looking forward desperately for some help:crazy: