Why does this work:
var words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];
const result = words.filter(
word => word.length > 6
);
console.log(result);
// expected output: Array ["exuberant", "destruction", "present"]
but after modifying this piece, doesn't:
const result = words.filter(
word => {
word.length > 6
}
);
Notice that I want to place word.length > 6
inside accolades where I want to actually have more complex intermediate calculations (more than 1 line).
Any advice please thanks.