Syntax Of Lodash flatten method
var _ = require('lodash'); var list = [1, [2], [4], 5, [[6]]]; var result = _.flatten(list) console.log(result);
We will discuss Lodash flatten method in this flattens array a single level deep.
Arguments
- array (Array) − The array to flatten.
Output
- (Array) − Returns the new flattened array.
Next Topic – Click Here
Pingback: Lodash - findLastIndex method - Adglob Infosystem Pvt Ltd
Pingback: Lodash - Array - Adglob Infosystem Pvt Ltd