Snippet format update
To match the starter (for the migration)
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
### get
|
||||
---
|
||||
title: get
|
||||
tags: object,intermediate
|
||||
---
|
||||
|
||||
Retrieve a set of properties indicated by the given selectors from an object.
|
||||
|
||||
@ -18,4 +21,4 @@ const get = (from, ...selectors) =>
|
||||
```js
|
||||
const obj = { selector: { to: { val: 'val to select' } }, target: [1, 2, { a: 'test' }] };
|
||||
get(obj, 'selector.to.val', 'target[0]', 'target[2].a'); // ['val to select', 1, 'test']
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user