Senior Software Engineer. Google Developers Expert. Entrepreneur. Mountain Climber. Cat Lover. Gardener. World traveler.
I am a Senior Software Engineer. Google Developers Expert. Entrepreneur. Mountain Climber. Neil Diamond fanatic. Cat lover. Gardener. World traveler.
Markdown supported · ⌘↵ to post
Philip Birk-Jensen
Great examples!
I like approach 2 the most, a tiny bit slower than #1 (not tested, just a hunch since the
filter()function tends to be slower thanforEach()), but easier to read and understand (a matter of taste).