Open In App

Underscore.js _.chunk() Function

_.chunk() function:

Syntax:



_.chunk(array, length) 

Parameters:
It takes two arguments:

Return value:
It returns the number of arrays that are formed after the split.



Examples:

NOTE:
These commands will not work in Google console or in firefox as for these additional files need to be added which they didn’t have added. So, add the given links to your HTML file and then run them. The links are as follows:




<script type="text/javascript" src =
</script>

An example is shown below:


Article Tags :