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

2438Re: "Use a named function" error

Expand Messages
  • Douglas Crockford
    Jul 6, 2011
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "Jordan" <ljharb@...> wrote:

      > var somefunc = function () {
      > ....var self = {
      > ........method: function () {
      > ............// do something
      > ............return self; // for chaining
      > ........}
      > ....};
      > ....return self;
      > },
      > somefunc().method().method();
      > --------------
      > I get the error "Problem at line 7 character 20: Use a named function self."
      >
      > When I remove the `somefunc` code, and just declare the `self` object, the error does not occur.

      Thanks. Please try it now.
    • Show all 3 messages in this topic