PEG.js Left Recursion

Sometimes it would be really easy to represent a rule using a Left-Recursive rule. For example:

MemberExpression  
    = object:MemberExpression '.' property:Identifier {
        return memberExpression(object, property, false);
    }

Unfortunately PEG.js doesn't do LR grammars but there's actually a rather elegant solution when you rethink the problem:

MemberExpression  
    = object:Identifier properties:MemberExpressionProperty+ {
        return properties.reduce(function (o, p) {
            return memberExpression(o, p, false);
        }, object);
    }

    MemberExpressionProperty
        = '.' property:Identifier {
          return property;
        }

Neat, huh?