Javascript group by multiple properties. copy the code to a file like array_object_multiple_order.