Skip to main content

How can the expansion of 'users.data.object.email' to object be implemented in javascript

Say I have this string/array: 'users.data.object.email' / [users, data, object, email]

How can I convert this string/array to a javascript object?

For example from the above string/array, the object would look like so:

{user: {
  data: {
    object: {
      email: {}
    }
  }
}
Via Active questions tagged javascript - Stack Overflow https://stackoverflow.com/questions/tagged/?tagnames=javascript&sort=active

Comments