Javascript Condition If Array Is Not Empty