Lodash教程

Lodash flatten method

语法:

var _ = require('lodash');
var list = [1, [2], [4], 5, [[6]]];
var result = _.flatten(list)
console.log(result);
Flattens array a single level deep.

参数

array (Array) − The array to flatten.

输出:

(Array) − Returns the new flattened array.
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4