Quick Question about "this" keyword

Right now I’m currently working through the lifecycle methods part of the React tutorial and I’ve noticed something that is confusing me. There is this particular piece of code:

this.fetchID = fetchUserData(this.props.username, (userData) => {
  this.setState({ userData });

I’ve looked through the rest of the file and never see where this.fetchID is declared. Is there something special with the “this” keyword where it doesn’t have to be declared with a const/let first?

Welcome to one of the most confusing things about Javascript!

In most programming languages, this is a keyword that you can use in functions when you want to refer to the object that is calling the function. In JavaScript it is similar, but has some very important differences. I suggest reading some articles on the this keyword in JS. But don’t be discouraged; it is quite confusing.