Why can I call a method in the constructor of a class if that method has not been declared yet?

I do not understand why I can call a method of a class in the constructor even if the code for that method is after the call. Shouldn’t I declare it first and then call it?

class ClassName {
  constructor() {
    this.functionName();
  }

  functionName() {
    console.log("Do something.");
  }
}

new ClassName();