[oopinjs] 'this' in global scope

17 views
Skip to first unread message

Quantbo

unread,
Aug 18, 2017, 8:36:50 AM8/18/17
to Zakas Books
On page 25 it says that in the global scope 'this' represents the global object. If 'use strict' is specified then 'this' is undefined.

Nicholas Zakas

unread,
Aug 18, 2017, 3:56:46 PM8/18/17
to Zakas Books
That's true inside a function. When you reference 'this' outside of a function in the global scope, it is still the global object.
On Fri, Aug 18, 2017 at 5:36 AM Quantbo <jvp...@gmail.com> wrote:
On page 25 it says that in the global scope 'this' represents the global object. If 'use strict' is specified then 'this' is undefined.

--
You received this message because you are subscribed to the Google Groups "Zakas Books" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zakasbooks+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages