From 3bb78b0cfdfdb9c2577aef73e079f31dfdd7ee88 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sun, 31 Dec 2017 17:05:50 +0200 Subject: [PATCH] Update sortedIndex.md --- snippets/sortedIndex.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/snippets/sortedIndex.md b/snippets/sortedIndex.md index d8c4946a6..f83da6ec0 100644 --- a/snippets/sortedIndex.md +++ b/snippets/sortedIndex.md @@ -1,6 +1,9 @@ ### sortedIndex -Returns the lowest index at which value should be inserted into array in order to maintain its sort order +Returns the lowest index at which value should be inserted into array in order to maintain its sort order. + +Check if the array is sorted in descending order (loosely). +Use `Array.findIndex()` to find the appropriate index where the element should be inserted. ```js const sortedIndex = (arr, n) => {