Javascript: isEven Function