code: function(attr) {
        var startIndex, newAttr,
          i = 0,
          hasEndBracket = true;
        startIndex = attr.indexOf('[', i);
        if (startIndex < 0) {
          return attr;
        }
        newAttr = attr.substring(0, startIndex + 1);
        while (startIndex > 0 && hasEndBracket) {
           i = attr.indexOf(']', i) + 1;
           hasEndBracket = i > 0;
           startIndex = attr.indexOf('[', i);
           if (startIndex > 0) {
             newAttr = newAttr + attr.substring(i - 1, startIndex + 1);
           }
        }
        newAttr = newAttr + attr.substring(i - 1);
        return newAttr;
      }
docs: Remove the indices for a field name: foo[1][2] -> foo[][]