Javascript function to check if object/array is 'empty' (no own keys)