JavaScript doesn't have block scoping, only function scoping. By creating and immediately invoking an anonymous function, we can guarantee that its local variables won't step all over the global namespace. It's basically a way to limit conflicts with other libraries that may be in play.