How can I retrieve the value of an object when its key is not a string, but I am given a string to search for the value?
Example: let obj={ arr: ["Kapil"]};
Find the value of obj.arr when you are given 'arr' as a key.
I tried using obj.'arr' but it returned undefined.
Is there a solution to this issue?
Any assistance would be greatly appreciated.