Function getValueByPath

  • Returns a value of an object property by path defined as array of strings, parent element comes first. Example: getValueByPath({parent: {value: 1}}, ['parent', 'value']); // returns value 1

    Parameters

    • obj: any

      Object to get value from

    • paths: string[]

      An array of strings, parent element comes first

    Returns any