Consider the following code snippet and determine the result.
Code snippet as a picture
Are there any issues with the
getId function? What will be logged to the console? (think well, then click for the answer and explanation)
getIdis an arrow function, so it doesn’t have
thisof its own.
It’s not bound to
objobject and when we try to get
this.idit will be evaluated to
undefinedwill be logged to the console