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

373Re: [jslint] Re: "Use the array literal notation []."

Expand Messages
  • James Clark
    Jan 30, 2009
    • 0 Attachment
      Douglas Crockford wrote:
      >
      >
      > --- In jslint_com@yahoogroups.com <mailto:jslint_com%40yahoogroups.com>,
      > James Clark <sbj@...> wrote:
      > >
      > > Part of my project uses a statement like the following:
      > >
      > > var b = new Array(a.length);
      > >
      > > but jslint complains:
      > >
      > > Use the array literal notation [].
      >
      > If you can demonstrate a significant performance advantage, then I
      > will relax the test. Stylistically, I think [] is better, but I will
      > bow to a compelling performance argument.

      I did a little experimenting and web-searching. I have found nothing
      conclusive, but some quickly-thrown-together tests found no significant
      difference in performance. So for now I will simply initialize the
      array with [].

      -jamie
    • Show all 5 messages in this topic