Loading ...
Sorry, an error occurred while loading the content.

Re: toJSON() and the replacer, also pretty printing

Expand Messages
  • Douglas Crockford
    ... I corrected the comment. ... Pretty is in the eye of the beholder. There are uses that need newlines in arrays. I don t want to complicate the calling
    Message 1 of 2 , Jul 16, 2008
    • 0 Attachment
      --- In json@yahoogroups.com, "Tyler Close" <tyler.close@...> wrote:
      >
      > There's a small inconsistency between the current documentation for
      > JSON.stringify() and the actual implementation (v. 2008-07-09).

      I corrected the comment.

      > I'd also prefer that no newline character be inserted between elements
      > in an array. When using the Firebug "Net" pane, the current
      > implementation requires scrolling for even short payloads. I like
      > having the newline between object members though. For some reason, my
      > arrays tend to be longer lists of literals, whereas object members are
      > more likely to be objects.

      Pretty is in the eye of the beholder. There are uses that need
      newlines in arrays. I don't want to complicate the calling sequence or
      complicate the code. What do you suggest?
    Your message has been successfully submitted and would be delivered to recipients shortly.