Access object properties using brackets
coco-super opened this issue · 2 comments
coco-super commented
Use the latest version and write the following code:
Parser.evaluate('in1["key"]', { in1: { key: 'value' } });
I expect the above code to output "value", but got undefined
Can you spare some time to have a look? Thank you. @silentmatt
coco-super commented
I try to find answers in other issues. Find similar problems, but this is not what I want. #114
coco-super commented
Line 253 in 6e889e0
The above code is modified as:
export function arrayIndex(array, index) {
if (Array.isArray(array)) {
return array[index | 0];
}
return array[index];
}
Then the world will be peaceful.