I'm really confused of getting the keys of arrays or objects.
How to get the key of:
var arr = [0, 2, 5];
findKey(array, 5);
How to get the key;
var obj = {'Abc': {name: 'Sample'}};
findKey(obj, 'Sample'); // Find the index, not abc. Get 0 here.
How to get the key:
var obj = {'Room1': ['User1', 'User2', 'User3']};
findKey(obj, 'User1'); // Find the index, not Room1. Get 0 here.