How to check if JavaScript Object is empty (Example)