3 ms·
Well for one you're missing a closing } in that function. But you could just do const showTable = ["email", "phone","website"] .reduce((previous, channel
by charrondev 10y ago
Well for one you're missing a closing } in that function. But you could just do
const showTable = ["email", "phone","website"]
.reduce((previous, channel) => { return previous || !!institution[channel] && !/^\s*$/.test(institution[channel])
}), false)
You can always just replace
function() {
with
() => {
and the only difference between the two would be binding this. Or you could do this:
const showsTable = ["email", "phone", "website"]
.reduce((previous, channel) => previous || !!institution[channel] && !/^\s*$/.test(institution[channel]), false)
- spinlock 10y agoBut, that's kinda my point. You shouldn't need the { for a one line function. also, I tried the solution you gave and it doesn't work :(