What is meant by lexical scope? I don’t understand what this means?


What is meant by lexical scope? I don’t understand what this means?

I was trying to understand why this:

http://ift.tt/2tmqoH9

prints "not awesome".

var obj = { id: "awesome", cool: () => { console.log( this.id ); } }; var id = "not awesome"; obj.cool(); 

Submitted July 14, 2017 at 12:48PM by 52kazoo
via reddit http://ift.tt/2tmqy1d

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s