From 7027e71cc6561fd2f06ce943e7c4bd85fbe2bbb9 Mon Sep 17 00:00:00 2001 From: Sree Date: Fri, 3 Jul 2015 16:03:07 +1000 Subject: [PATCH] Typo Fix --- up & going/ch2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/up & going/ch2.md b/up & going/ch2.md index 6c1a588db..63f436a1a 100644 --- a/up & going/ch2.md +++ b/up & going/ch2.md @@ -747,7 +747,7 @@ fred.login( "fred", "12Battery34!" ); The `User()` function serves as an outer scope that holds the variables `username` and `password`, as well as the inner `doLogin()` function; these are all private inner details of this `User` module that cannot be accessed from the outside world. -**Warning:** We are not callling `new User()` here, on purpose, despite the fact that probably seems more common to most readers. `User()` is just a function, not a class to be instantiated, so it's just called normally. Using `new` would be inappropriate and actually waste resources. +**Warning:** We are not calling `new User()` here, on purpose, despite the fact that probably seems more common to most readers. `User()` is just a function, not a class to be instantiated, so it's just called normally. Using `new` would be inappropriate and actually waste resources. Executing `User()` creates an *instance* of the `User` module -- a whole new scope is created, and thus a whole new copy of each of these inner variables/functions. We assign this instance to `fred`. If we run `User()` again, we'd get a new instance entirely separate from `fred`.