[英]else condition is getting true before if condition
Here is my javascript code. 这是我的JavaScript代码。 Initially, the else coding is being true before if the condition becomes true. 最初,如果条件为真,则else编码为真。
for(m=0;m<object[l].get("name").length;m++){
if(object[l].get("name")[m]==userName){
valid(userName);
} else {
notValid(userName);
}
}
If userName
is not equal with object[l].get("name")[m]
, then else part will execute. 如果userName
与object[l].get("name")[m]
不相等,则其他部分将执行。 If first object name matches with userName
(means object[l].get("name")[0]
matched with userName
) then if block will execute first 如果第一个对象名称与userName
匹配(意味着object[l].get("name")[0]
与userName
匹配),则if块将首先执行
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.