Доступ врученного Javascript-of-and-arrays-string-path

function resolve(path, obj=self, separator='.') {
    var properties = Array.isArray(path) ? path : path.split(separator)
    return properties.reduce((prev, curr) => prev && prev[curr], obj)
}
Octavian Lelescu