Seriously is there any way to shorten this JS code?
Edward Chu
1

This shows the most complex scenario for fairness. In many scenarios you’ll simply say onClick={myFunc}.

Same rules apply here as with any JS. Sometimes you need to .bind when you’re concerned with the meaning of this, or you need to close over a value.

Like what you read? Give Cory House a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.