GeoServe interview question

Implement a function similar to lodash get.