Lodash.js - sortedLastIndex() function
A simple Lodash.js example of the sortedLastIndex() function, we will find the highest index of the provided by us value, if the value would have been present in the array and sorted in the ascending order.
12345678910111213141516171819202122232425262728<!DOCTYPE html>charset="utf-8"name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"name="description" content="Tizen example"Tizen lodash.js examplesrc="js/lodash.min.js"id="first"id="second"var firstDiv = document.getElementById('first');var secondDiv = document.getElementById('second');var firstValue = [12,15,19,20,20,20,22,25,28];firstDiv.innerHTML = "Having the array of values " + firstValue + " we will find the highest index of the provided by us value, if the value would have been present in the array and sorted in the ascending order...";var result = _.sortedLastIndex(firstValue, 20);secondDiv.innerHTML = "...and we get: " + result;