DEV Community

Lei Huang
Lei Huang

Posted on

Common Mistakes

this

1. What does "this" refer to?

image

"this" in a method refer to car (not Car) in this situation.
看call function的时候,最左边的是什么,this就是指什么

2.How to solve "undefined" problem caused by "this"?

用arrow function.

Top comments (0)