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

651Re: [json] parseJSON

Expand Messages
  • Michael Schwarz
    Jan 10, 2007
    • 0 Attachment
      Hi Douglas,

      as I can remember you wrote some weeks ago that parseJSON will be
      added, too, I would say yes, and I like the filter method more than
      using parameter.

      Michael


      On 1/10/07, Douglas Crockford <douglas@...> wrote:
      >
      > The parseJSON method currently takes a filter function parameter. It
      > will be invoked for every name/value in the structure.
      > myData = text.parseJSON(function (key, value) { return
      > key.indexOf('date') >= 0 ? new Date(value) : value; });
      > The filtration mechanism is just a general purpose map function. It
      > could be exposed as a separate method and used independently. If we were
      > to do that, then it could be used like this:
      > myData = text.parseJSON().filter(function (key, value) { return
      > key.indexOf('date') >= 0 ? new Date(value) : value; });
      > Do you think a general purpose .filter method is useful? Should it be
      > added to ECMAScript?
      >
      >
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >


      --
      Best regards | Schöne Grüße
      Michael

      Microsoft MVP - Most Valuable Professional
      Microsoft MCAD - Certified Application Developer

      http://weblogs.asp.net/mschwarz/
      http://www.ajaxpro.info/

      WPF/E: http://groups.google.com/group/wpf-everywhere

      Skype: callto:schwarz-interactive
      MSN IM: passport@...
    • Show all 7 messages in this topic