Hacker News new | ask | show | jobs
by charrondev 3471 days 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)
1 comments

But, 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 :(