is it correct?-
if (expiryMonth == "MM" || expiryMonth == "mm") {
is it correct?-
if (expiryMonth == "MM" || expiryMonth == "mm") {
Yes, that's correct. MDC (Mozilla Developer Center) has plenty of information about logical operators.
You could eliminate the need for the or statement and just set expiryMonth to lowercase.
expiryMonth=expiryMonth.toLowerCase(); // You can also use toUpperCase();
Then run your if statement.
Yes, that's correct. You may be able to avoid the use of || in this situation by using the toLowerCase() or toUpperCase() method on strings:
if (expiryMonth.toLowerCase() == "mm") {
or
if (expiryMonth.toUpperCase() == "MM") {
Of course, this would also match Mm and mM, as Tim points out in the comments.