I started a new job and have limited experience with Javascript. I found a piece of code that really confuses me:
export default class Foo
{
constructor()
{
this.bar = this.bar.bind(this); // the line that confuses me
}
bar(...) {...}
}
Is this line redundant? If not, what does it do?