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
349 B

4 years ago
## Get
### Instructions
Create a function named `get` which takes two arguments:
4 years ago
- `src`: an object.
- `path`: a string representing a path.
Your function will return the value at the given `path` in the `src` object.
4 years ago
### Example:
4 years ago
```js
const src = { nested: { key: 'peekaboo' } }
const path = 'nested.key'
get(src, path) // -> 'peekaboo'
```