Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 2
    Note that the language is JavaScript (OP mentions using JSHint, which is a JavaScript linting tool), so the functional operations on arrays you suggest and first-class functions are both available and idiomatic. Commented Feb 22, 2017 at 12:15
  • Haven't looked at any or map yet (maps are something I've used in PHP though), will have to do some further learning. The early return strategy had occurred to me, but the function in which these calls are made sets some other tags too and I was loathe to break it down any further into once-used functions with ridiculously long names. Commented Feb 22, 2017 at 23:18