Javascript If Array Length Method