• Returns the property value if property name is present on the given object

    Parameters

    • object: any

      the object to inspect

    • Optionalprop: null | string

      the property name to inspect, parent property and child property are concat with dot (.)

    Returns any

    the property value if property name is present on the given object

    getProp({foo: {bar: 'foobar'}}, 'foo.bar');    // foobar