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

[jslint] Re: new Array(3)

Expand Messages
  • Douglas Crockford
    ... Readability is paramount. So the inherent off-by-one problem in the trick makes it hazardous. Certainly it does not justify keeping new Array in the safe
    Message 1 of 8 , Nov 30, 2010
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, Morgaut Alexandre Louis Marc <morgaut@...> wrote:
      > Please note also that priority must not be always focused on perf
      >
      > These must also be considered:
      > - Readability of the code
      > - Less code === Less potential error hidden in the pattern (wrong copy/paste or error while typing)

      Readability is paramount. So the inherent off-by-one problem in the trick makes it hazardous. Certainly it does not justify keeping new Array in the safe subset. The fact that new Array(3) is not the same as [3] is a more serious problem than the need to make a string with the wrong number of stars in it.

      Is there another essential use for new Array?
    Your message has been successfully submitted and would be delivered to recipients shortly.