Condition In Array Javascript Methods List