sx-array-column

1.0.1 • Public • Published

sx-array-column

介绍

返回输入数组指定列

安装教程

  1. npm i sx-array-column

使用说明

import sxArrayColumn from "sx-array-column";

const arr = [{id: 1, name: "zhangsan"}, {id: 2, name: "lisi"}, {id: 3, name: "wangwu"}];

console.log(sxArrayColumn(arr, "name")); // 返回 ["zhangsan", "lisi", "wangwu"]

console.log(sxArrayColumn(arr, "name", "id")); // 返回 [ { '1': 'zhangsan' }, { '2': 'lisi' }, { '3': 'wangwu' } ]

问题反馈

  1. callbackbing@163.com

Readme

Keywords

Package Sidebar

Install

npm i sx-array-column

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

2.17 kB

Total Files

4

Last publish

Collaborators

  • shi-xi