How to use if condition with Javascipt function ?
I'm trying to check whether ACM data field contains a particular string using if condition. However, that portion isn't working.
I have used below snippet. Can anyone please tell me if there's any issue with the snippet?
<% if ( (rtEvent.ctx.Consumer.PaymentMethod).includes("Direct Pay")) { %> <li>Order ID - <%=rtEvent.ctx.Consumer.OrderId%></li><% } %>
I have already checked value of rtEvent.ctx.Consumer.PaymentMethod -- it is having value 'Direct Pay' (including quotes).
I can't use "==" for "if" condition. Current value is 'Direct Pay' and after few weeks, it will be Direct Pay.
So I need to use "includes" or any similar method for checking.
Thank you for your help.