mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
291 B
19 lines
291 B
4 years ago
|
## Get
|
||
|
|
||
|
### Instructions
|
||
|
|
||
|
Create the `get` function.
|
||
|
It takes 2 arguments:
|
||
|
- `src` an object
|
||
|
- `path` a string
|
||
|
|
||
4 years ago
|
And returns the value at the given string path.
|
||
|
|
||
4 years ago
|
|
||
4 years ago
|
### Example:
|
||
4 years ago
|
```js
|
||
|
const src = { nested: { key: 'peekaboo' } }
|
||
|
const path = 'nested.key'
|
||
|
get(src, path) // -> 'peekaboo'
|
||
|
```
|