title: Do nested functions of Javscript get defined everytime the nesting functions get called?
body: <p>From <a href="https://stackoverflow.com/questions/19251479/javascript-nested-functions-initialization">this</a> question, I found nested functions created each time the nesting functions get called as I expected. But the word 'create' doesn't make it clear about this question. Do Javascript engines have to interpret the <strong>definition</strong> of the nested functions everytime as well? I'm asking this question in wondering if the engines save the definition of a nested function somewhere and will return a function bound with some variables that are used in the nested function like below code does.</p>
  <pre><code>class A {
      functionForInstance = this.sharedDefinition.bind(this);
  
      sharedDefinition() {
          return this.someField;
      }
  }
  </code></pre>
  <p><strong>One more question</strong></p>
  <p>According to @Jose Marin's answer, engines create closures(instances) from saved function definitions. Then does it also apply to arrow functions?</p>