- lodash provides Array, Chain, Collection, Date, Function, lang, Number, Object, String ,Utlity, Object, String, Methods and Properties.
- documentation for lodash library can be found in following link https://lodash.com/docs.
- In this demo, “We will see some examples of using lodash utility methods”.
- The code for this demo is as follows:
<title>loadash utility library demo</title>
var fruitArray = ["Apple","Orange","Mango","Grapes","Banana"];
console.log("First element in fruitArray: ", _.first(fruitArray));
console.log("Last element in fruitArray: ", _.last(fruitArray));
var chainStudentArray= _.chain(studentArray);
console.log("Chain: student with lowest roll: ",
- The following screenshot shows the output of the above code in Chrome developer console: