I am looking for way to sort an Array elements based on another Array element’s class.
Below is such an example->
order = ['String','Integer','NilClass','TrueClass' ] arry = [1,2,3,4,5, true, false, nil,34,nil, 'Hello', 'World']
How can I sort arry Array values based on order Array element’s class ?
When I sort arry based on order Array, the result should be
result_arry = ['Hello', 'World', 1, 2, 3, 4, 5, 34, nil, nil, true]
Note: In order Array, elements order is dynamic.