ES6 introduced a new way to express function in our codes, arrow function. It is a more compact way of expressing function with some bits of difference with regular function. Before ES6, we can do something like this to make a function: In ES6 we can do the same thing with the following syntax: It…
When we get into React we might see some event handling with
this.handleClick = this.handleClick.bind(this); In fact, that was an example from one of React’s documentation. This ‘binding’ is called Constructor Bind, we can use another way to handle an event, by using Class properties.