chaining.js 118 Bytes
export const optionalChaining = (obj, ...rest) => {
  return rest.reduce((newObj, key) => newObj?.[key], obj) || ''
}