A question about sort

sort has a by params so do this

sort(x, by = imag)

2 Likes