code: private Node tryFoldGetProp(Node n, Node left, Node right) {
      checkArgument(n.isGetProp());
  
      if (left.isObjectLit()) {
        return tryFoldObjectPropAccess(n, left, right);
      }
  
      if (right.isString() &&
          right.getString().equals("length")) {
        int knownLength = -1;
        switch (left.getToken()) {
          case ARRAYLIT:
            if (mayHaveSideEffects(left)) {
              // Nope, can't fold this, without handling the side-effects.
              return n;
            }
            knownLength = left.getChildCount();
            break;
          case STRING:
            knownLength = left.getString().length();
            break;
          default:
            // Not a foldable case, forget it.
            return n;
        }
  
        checkState(knownLength != -1);
        Node lengthNode = IR.number(knownLength);
        reportChangeToEnclosingScope(n);
        n.replaceWith(lengthNode);
  
        return lengthNode;
      }
  
      return n;
    }
docs: Try to fold array-length. e.g [1, 2, 3].length ==> 3, [x, y].length ==> 2