The context here is I am looking at a React.js application, and I see:
const _onClick = _ => setClick(!clicked);
If I understand it correctly, this is shorthand for something like:
const _onClick = () => { setClick(!clicked); }
Or, pre-ES6:
var _onClick = function() {
setClick(!clicked);
}
But I've never seen an arrow function without parentheses. Is the underscore a function name?