What is :: before this keyword in React JS?

In some reaction libraries, I see some syntax as shown below. What does this mean and how can I help in my codes?

const inputAttributes = { id: 'events-playground', placeholder: 'Where are you now?', onChange: ::this.onInputChanged, onBlur: ::this.onInputBlurred }; 

Thanks.

+6
source share
1 answer

This is the new ES7 syntax for .bind ,

equivalent in ES5

 const inputAttributes = { id: 'events-playground', placeholder: 'Where are you now?', onChange: this.onInputChanged.bind(this), onBlur: this.onInputBlurred.bind(this) }; 
+12
source

All Articles