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

SV: [jslint] Re: new Array(3)

Expand Messages
  • Jakob Kruse
    Actually, it seems you made some errors in a couple of the tests that could invalidate the results. In ‘array literal joining char’ and ‘array literal
    Message 1 of 2 , Nov 30, 2010
    • 0 Attachment
      Actually, it seems you made some errors in a couple of the tests that could invalidate the results. In ‘array literal joining char’ and ‘array literal .length property’ you use a string instead of the char variable for your joins.

      /Jakob


      Fra: jslint_com@yahoogroups.com [mailto:jslint_com@yahoogroups.com] På vegne af Marcel Duran
      Sendt: 30. november 2010 11:56
      Til: jslint_com@yahoogroups.com
      Emne: Re: [jslint] Re: new Array(3)


      >
      >
      > http://tech.groups.yahoo.com/group/jslint_com/message/614
      >
      > Provides an elegant & effective solution without the use of new Array(n+1)
      > and it operates quickly in all modern browsers.
      >
      > I've just made a JSPerf benchmark comparing these various ways of creating
      a string of n repeated character:

      http://jsperf.com/string-of-n-character

      Seems like new Array and [].length are the slowest ones at least in latest
      version of Chrome. Feel free to run this test in different browsers and let
      browserscope take care of benchmark results.

      Marcel

      [Non-text portions of this message have been removed]


      [Non-text portions of this message have been removed]
    • Marcel Duran
      I ve just fixed the test problems, thanks all for detecting these errors. FYI, JSPerf allows anyone to edit any test by appending /edit to the url test, so you
      Message 2 of 2 , Nov 30, 2010
      • 0 Attachment
        I've just fixed the test problems, thanks all for detecting these errors.
        FYI, JSPerf allows anyone to edit any test by appending /edit to the url
        test, so you can fix/add more tests for new revisions.

        http://jsperf.com/string-of-n-character

        Marcel


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.