Alex Kneller
Alex Kneller

Reputation: 413

Check if javascript array contains not only empty values

I want check if array contains not only empty strings or nulls.

arr = ['','','','','',''];

What is the most elegant way without loops to do it?

Upvotes: 0

Views: 127

Answers (1)

Alex Kneller
Alex Kneller

Reputation: 413

This is my best solution for now because array.filter have worse browser support.

if(!arr.join('')){/*your code*/}

Upvotes: 1

Related Questions