I am trying to check if an object in an array is same as the object and if they are the same then use splice method to extract that particular object and others after to another array and then reverse them without reverse function. Please help
function func()
{
for(var i = 0; i < array.length; i++)
{
if(array[i].key == object.key)
{
2ndarray.splice(0,0,array[i]);
break;
}
}
}