![]() |
With the help of _.iterators.numbers() method, we can get the integer value from the iterator function which will begin with the argument given in this method and increment one by one when invoked by using this method. Syntax: _.iterators.numbers(start) Parameter: This method accepts a single parameter as mentioned above and described below:
Return value: Return the value starts from given argument. Note: To execute the below examples you have to install the underscore-contrib library by using this command prompt we have to execute the following command. npm install underscore-contrib Below examples illustrate the Underscore.js _.iterators.numbers() method in JavaScript: Example 1: In this method, we can see that by using _.iterators.numbers() method, we are able to get the integer value from the iterator function and increment the value by one when invoked every time by using this method. Javascript
Output: 20 21 22 23 24 Example 2: Javascript
Output: 8 9 10 11 12 13 14 15 16 17 |
Reffered: https://www.geeksforgeeks.org
JavaScript |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 10 |