![]() |
With the help of _.iterators.K() method, we can get the function which when called generate a value from the given value by using this method. Syntax: _.iterators.K(value) Parameter: This method accepts a single parameter as mentioned above and described below:
Return:Return a single value at a time when function called. 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.K() method in JavaScript: Example 1: In this example, we can see that by using _.iterators.K() method, we are able to get the function which gives a value which is defined when iterator created by using this method. Javascript
Output : 'Geeks for Geeks' Example 2: Javascript
Output : 3.141592653589793 |
Reffered: https://www.geeksforgeeks.org
JavaScript |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 9 |