I am seeing some var self = this; or const self =...
# suitecommerce
s
I am seeing some var self = this; or const self = this; Can someone explain why this is being declared in SCA?
this
is a contextual variable returning the object associated with the current scope
When you enter a function the value of
this
changes to the function. This means if you need access to the outer object, you will need first to assign it a variable name
👍 1
💯 1
So our lexical style is to call the variable
self
👍 1