Javascript string into array depth object : <p>Sorry if the title is confusing, I'm confused my self.</p>

<p>So its like this, I get a string from api like this: 'data.data.type'.</p>

<p>And I need to turn it into this response['data]['data]['type'].</p>

<p>Any idea how I can achieve this?</p>
