Javascript Filter Out Empty Objects In Python Example