Groovy – sort()
Returns a sorted copy of the original List. Syntax List sort() Parameters None Return Value The sorted list. Example Following is an example of the usage of this method −…
Returns a sorted copy of the original List. Syntax List sort() Parameters None Return Value The sorted list. Example Following is an example of the usage of this method −…
Syntax Of Lodash flatten method var _ = require('lodash'); var list = [1, [2], [4], 5, [[6]]]; var result = _.flatten(list) console.log(result); We will discuss Lodash flatten method in this…
Syntax Of Lodash findLastIndex method _.findLastIndex(array, [predicate=_.identity], [fromIndex=array.length-1]) This Lodash findLastIndex method is like _.findIndex except that it iterates over elements of collection from right to left. Arguments array (Array) −…
Syntax Of Lodash findIndex method _.findIndex(array, [predicate=_.identity], [fromIndex=0]) This Lodash findIndex method is like _.find except that it returns the index of the first element predicate returns truthy for instead…
Syntax of Lodash fill method _.fill(array, value, [start=0], [end=array.length]) The Lodash fills method elements of the array with the value from start-up to, but not including, end. Arguments array (Array) −…
Syntax Of Lodash drop While methods _.dropWhile(array, [predicate=_.identity]) Lodash drop While methods Create a slice of array excluding elements dropped from the beginning. Elements are dropped until the predicate returns…
Syntax Of Lodash drop Right While method _.dropRightWhile(array, [predicate=_.identity]) The Lodash drop Right While method Creates a slice of array excluding elements dropped from the end. Elements are dropped until…
Obtains the number of elements in this List. Syntax int size() Parameters None Return Value The size of the list. Example Following is an example of the usage of this…
Create a new list that is the reverse the elements of the original List. Syntax List reverse() Parameters None Return Value The reversed list. Example Following is an example of…
Removes the element at the specified position in this List. Syntax Object remove(int index) Parameters Index – Index at which the value needs to be removed. Return Value The removed…