DEV Community

Discussion on: Rethinking JavaScript: The complete elimination and eradication of JavaScript's this.

Collapse
 
joelnet profile image
JavaScript Joel

I'm not sure what is so hard to follow. I could boil it down to 3 words: Stop using this.

The articles I write all preach a functional reactive paradigm. You might enjoy How I rediscovered my love for JavaScript after throwing 90% of it in the trash.

While my code doesn't require the use of this, there are many 3rd party libraries which force you to use this.

Example:

const events = new EventEmitter2({ wildcard: true })

events.on('button.*', function() {
  console.log('event:', this.event)
})

events.emit('button.click')

or choose a different languge

The "If you don't like it go somewhere else approach" is not a solution.