(array)
| 135 | * @returns {boolean} true, if the array is sorted |
| 136 | */ |
| 137 | const isSorted = (array) => { |
| 138 | for (let i = 1; i < array.length; i++) { |
| 139 | if (array[i - 1] > array[i]) return false; |
| 140 | } |
| 141 | return true; |
| 142 | }; |
| 143 | |
| 144 | /** |
| 145 | * Returns the object with properties sorted by property name. |