Updating `array.sort()` to use brace notation for creating `bool` variable