Replace Array With New Array Javascript Push Function In Python