Html Javascript Check If Array Has Values Clarification