fix to follow the code style
This commit is contained in:
@ -6,9 +6,7 @@ If property not exists returns `undefined`.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
const select = (from, selector) =>
|
const select = (from, selector) =>
|
||||||
selector
|
selector.split('.').reduce((prev, cur) => prev && prev[cur], from);
|
||||||
.split('.')
|
|
||||||
.reduce((prev, cur) => prev && prev[cur], from);
|
|
||||||
|
|
||||||
// const obj = {selector: {to: {val: 'val to select'}}};
|
// const obj = {selector: {to: {val: 'val to select'}}};
|
||||||
// select(obj, 'selector.to.val'); -> 'val to select'
|
// select(obj, 'selector.to.val'); -> 'val to select'
|
||||||
|
|||||||
Reference in New Issue
Block a user