I want to check if array has any elements that are instances of Array. I could make a recursive function and that iterates and finds all elements that are Array. Is there a shorter way to do this?
Get all elements that are of x type and manipulate them (i.e. modify or delete them)
arr.flatten.size > arr.sizeworks, but @sawa's answer is more efficient and reads better.array.flatten == arraymay work.afromarreverything withinais gone, of course. Moreover, it would make no sense to start at the "bottom" and work up, because when you get to the "top" and deleted the elementaofarr, all your previous work would have been just a waste of time--those deletions would have occurred anyway had you just deletedain the first place.