Skip to content

code example for Namespacing Pattern IIFE does not work #140

Closed
@joyously

Description

In the section "Namespacing Patterns", the code given in #5. Immediately-invoked Function Expressions (IIFE)s does not quite work.
The first long part given works, but the second part that is supposed to extend the namespace does not work.

I tested this by copying both sections to a jsFiddle and changing the console.log calls to alert calls. The call to sayGoodbye is executed, but the value of foo and bar are undefined and the call to speak throws a ReferenceError. If I put the namespace name in front of speak, it then throws a TypeError, saying it is not a function.

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions