The parenthesis around input arguments (x
in this case) are only required when there are two or more input arguments. With just one (as you've shown here), the two statements are identical.
(x) => { return x * 2; }
is the same as x => { return x * 2; }
But,
(x, y) => { return x * y; }
Requires parenthesis around the input arguments.
See this for all the gory details!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…