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

1381[jslint] Re: explanations for some options

Expand Messages
  • Douglas Crockford
    Jul 21, 2010
      --- In jslint_com@yahoogroups.com, "pauanyu" <pcxunlimited@...> wrote:

      > Some benefits of ECMAScript 5 strict mode:
      > typeof [] returns "array" rather than "object"
      > typeof null returns "null" rather than "object"

      Not true. typeof remains broken. An Array.isArray method is added.

      > If you forget to use "new" when using a constructor, like new Foobar(), it will throw an error. Before, it would silently attach the constructor's properties to the global object (usually window).

      Not exactly. this will be bound to undefined, which might result in throwing.

      > The special "this" variable correctly propagates within inner functions. For instance, this code will run correctly:
      > var foo = {
      > message: "Hello world",
      > saySomething: function () {
      > return (function () {
      > return this.message;
      > }());
      > }
      > };

      Not true. this in all inner functions is undefined.
    • Show all 6 messages in this topic