Javascript Condition If Array Exists