Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Correct me if I'm wrong, but
Hey is a function (name) that exists of an anonymous function(activity)? -
Hey is a function that accepts name and returns a function that accepts activity.
hey = function(name) {
return function(activity){}
} -
@ImJosh Look at functions as objects.
heyJosh = hey("Josh")
heyJosh is now a function(activity) -
@incognito @ImJosh sorry, I use them inside a React.component so I don’t put const in front of variables.
This is same as function(name){ return function(activity){ ... }}. If you interested, type it in and take a look at Babel transform result.
Why is it useful?
<button onClick={this.onClick(param)} />
So I can pass some parameters into onClick event, and still receive event -
(a=>a.bind(0,a))(a=>a.bind(0,a))()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
// My favourite line of code ever
Related Rants
I'm really digging this double arrow syntax right now
rant
es6
js