Skip to content

Access object properties using brackets #114

@guisehn

Description

@guisehn

Is there a way to access object properties using brackets? Currently, it seems there's no way to access an object property that has spaces on its name. e.g.

let expr = Parser.parse('a["property with spaces"]');
console.log(expr.evaluate({ a: { 'property with spaces': 5 } }));

throws

Error: parse error [1:2]: Unknown character "["

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions