There is the following object: subcats = {20: [49, 50, 51], 16: [54, 55]};
How can I find the key of the object to which the number found in its array falls?
Suppose I got the number 50 , so in subcats this value is a child of 20 . The same with 55 or 54 - should get 16 .
Tried methods find and findIndex but there only simple arrays.