View Single Post
Old 01-17-2013, 10:34 AM   PM User | #1
hafizrashid
New to the CF scene

 
Join Date: Jan 2013
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
hafizrashid is an unknown quantity at this point
sick to complete this code

hi there.

anyone can help me to complete this

3. The following Javascript function, while grammatically correct, is sometimes unreliable. It is to be deprecated and you have been tasked to create a new function. It should accept an array parameter and assign each element in the array value to the supplied input value. If input array is a multi dimensional array it should reset the children elements as well.

function myresetter_func (counter, arr1, str)
{
i = q = counter = 0;
temp = arr1;

for (var i=0;i<temp.length;i++){
if(temp[i].length > 0)
{
for (q=0;q<temp[i].length;q++)
{
temp[i][q] = str;
}
} else
temp[i] = str;
}
return temp;
}
hafizrashid is offline   Reply With Quote