I want to convert string to expression but the issue is I'm accessing an array and the index is a string that should be numeric.
E.g.: path = 'this.categoriesData[1].children[0]'
Error: Uncaught TypeError: Cannot read properties of undefined (reading '1')
The error is from eval(path)
.
Can anyone help me with this?