DEV Community

Discussion on: An Overview of JavaScript Functions

Collapse
 
dallgoot profile image
dallgoot

on binding:

//code excerpt
greet: function(){
  let self = this;   
  return function(){
        return 'hello' + ' ' +  self.name;  
  }.bind(this)      
}
//end of excerpt

i think you forgot to remove the self and replace it with this, since it is bound ?

Collapse
 
howtocodejs profile image
HowToCodejs

You are absolutely correct. The mistake has been corrected. Thanks!

Collapse
 
dallgoot profile image
dallgoot

same thing on the Es6 arrow function ;)
i won't annoy you anymore ;)

Thread Thread
 
howtocodejs profile image
HowToCodejs

Don't worry. Feedback is welcome!