function getValueByKeys(obj, var_args) {
  const isArrayLike = goog.isArrayLike(var_args);
  const keys = isArrayLike ?
      /** @type {!IArrayLike<number|string>} */ (var_args) :
      arguments;

  // Start with the 2nd parameter for the variable parameters syntax.
  for (let i = isArrayLike ? 0 : 1; i < keys.length; i++) {
    if (obj == null) return undefined;
    obj = obj[keys[i]];
  }

  return obj;
}
Get a value from an object multiple levels deep.  This is useful for
pulling values from deeply nested objects, such as JSON responses.
Example usage: getValueByKeys(jsonObj, 'foo', 'entries', 3)
@param {?Object} obj An object to get the value from. Can be array-like.
@param {...(string|number|!IArrayLike<number|string>)} var_args A number of
    keys (as strings, or numbers, for array-like objects). Can also be
    specified as a single array of keys.
@return {*} The resulting value. If, at any point, the value for a key in the
    current object is null or undefined, returns undefined.