```js const tree = arrayToTree(arr, { transform: ['id', 'key1'], // transform: item => { return { id: item.id, key1: item.key1 } }, }); ```