Snippet format update
To match the starter (for the migration)
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
### isSorted
|
||||
---
|
||||
title: isSorted
|
||||
tags: array,intermediate
|
||||
---
|
||||
|
||||
Returns `1` if the array is sorted in ascending order, `-1` if it is sorted in descending order or `0` if it is not sorted.
|
||||
|
||||
@ -21,4 +24,4 @@ const isSorted = arr => {
|
||||
isSorted([0, 1, 2, 2]); // 1
|
||||
isSorted([4, 3, 2]); // -1
|
||||
isSorted([4, 3, 5]); // 0
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user