2021年4月8日星期四

Access Object with Array of strings

if i have an array

const arr = ['this', 'is', 'my', 'test'];

how can i dynamically do

myObj[arr[0]][arr[1]][arr[2]]

https://stackoverflow.com/questions/67013760/access-object-with-array-of-strings April 09, 2021 at 09:08AM

没有评论:

发表评论