DEV Community

Discussion on: Implementing a Bubble Sort Algorithm in JavaScript

Collapse
 
theoluyi profile image
theoluyi

Really precise writing! I paused reading the code at first trying to figure out what the heck the point was of assigning and then immediately reassigning isSorted. As soon as I read your explanation of it being used to "escape from the while loop" it made total sense. 👍

Collapse
 
seanwelshbrown profile image
Sean Welsh Brown

Thanks Theo! I'm glad that part wasn't too confusing, I was doing my best to try and frame it so that people wouldn't be left hanging on that part for too long-- I know it's a bit of a weird leap of logic until you understand the next part.