Javascript Check Array Not Null Python