- Lodash Tutorial
- Lodash - Home
- Lodash - Overview
- Lodash - Environment Setup
- Lodash - Array
- Lodash - Collection
- Lodash - Date
- Lodash - Function
- Lodash - Lang
- Lodash - Math
- Lodash - Number
- Lodash - Object
- Lodash - Seq
- Lodash - String
- Lodash - Util
- Lodash - Properties
- Lodash - Methods
- Lodash Useful Resources
- Lodash - Quick Guide
- Lodash - Useful Resources
- Lodash - Discussion
Lodash - rangeRight method
Syntax
_.rangeRight([start=0], end, [step=1])
This method is like _.range except that it populates values in descending order.
Arguments
[start=0] (number) − The start of the range.
end (number) − The end of the range.
[step=1] (number) − The value to increment or decrement by.
Output
(Array) − Returns the range of numbers.
Example
var _ = require('lodash'); console.log(_.rangeRight(4)); console.log(_.rangeRight(0, 20, 5));
Save the above program in tester.js. Run the following command to execute this program.
Command
\>node tester.js
Output
[ 3, 2, 1, 0 ] [ 15, 10, 5, 0 ]
lodash_util.htm
Advertisements
To Continue Learning Please Login
Login with Google