oPageHref.href = "http://" + bTest?arrSections[i]:"none";
这句语句的运行顺序不是所想的: "http://" + (bTest?arrSections[i]:"none");
相反地是: ( "http://"+bTest)?arrSections[i]:"none";
造成我的困扰.
本文探讨了一段JavaScript代码中关于条件运算符的使用误区,解释了预期与实际执行顺序的不同,帮助开发者理解如何正确使用条件运算符。
oPageHref.href = "http://" + bTest?arrSections[i]:"none";
这句语句的运行顺序不是所想的: "http://" + (bTest?arrSections[i]:"none");
相反地是: ( "http://"+bTest)?arrSections[i]:"none";
造成我的困扰.
转载于:https://www.cnblogs.com/norsd/archive/2009/01/22/6359533.html
986

被折叠的 条评论
为什么被折叠?