O'Reilly logo
  • Jenny Tien thinks this is interesting:

if (i <= j) { //{14}

From

Cover of Learning JavaScript Data Structures and Algorithms - Second Edition

Note

Probably missing something though it's unclear why you would actually perform the swap when the indexes are equal. Seems like you can just increment the indexes and skip the swap.