Javascript New Array Method Python