By Hemanta Sundaray on 2021-06-27
_.range(start, end, step)
Creates an array of numbers progressing from start up to, but not including, end.
start (number): The start of the range.
end (number) : The end of the range
step (number): The value to increment or decrement by.
_.range(5)
// [0, 1, 2, 3, 4]
_.range(1, 5)
// [1, 2, 3, 4]
_.slice(array, start, end)
Creates a slice of array from start up to, but not including, end.
_.take(array, number);
Creates a slice of array with n elements taken from the beginning.
_.take([1, 2, 3])
// [1]
_.take([1, 2, 3], 2)
// [1, 2]