Can someone please explain the following:
I follow Dan Abramov’s lectures and do exercises.
The code works fine, but tests fail when the next specific function is written in curly brackets **{ }** .
case 'toggleTodo' : return ( state.map( (one) => { oneTodo( one, action ) }) );
The same code works fine without curly braces.
case 'toggleTodo' : return ( state.map( (one) => oneTodo( one, action ) ) );
Here is the JsBin . Please refer to line 31 onwards.
javascript ecmascript-6 curly-braces arrow-functions brackets
Kayote
source share