check if array has empty values javascript