I am just performing simple Logical AND Operation inside Script mediator of WSO2 EI 6.6.0
Code:
<script language="js"><![CDATA[
var log = mc.getServiceLog();
var initial_group="L1";
var initial_queue ="";
if( (initial_group =="L1") && (initial_queue ="WIN")){
log.info("Matching success!");}
else{
log.info("Matching failed!");
}
]]></script>
Even though i passed initial_queue
as empty, &&
condition of if
statement is matched and finally it produce output like below
Matching success!
Instead of Matching failed!
Can anyone explain this strange behavior of Logical &&
Operator?