<script>
alert(typeof addB);
var addB = "variable";
function addB() {
alert("function addB");
}
alert(addB);
</script>
执行结果是"function"和"variable"。
JS解析器先预定义了 addB 变量为 undefined, 但是 addB 函数覆盖了此变量,因此一开始执行结果是 function,然后 addB 被赋值为 "variable",因此最后执行结果是 "variable"
/**
new Expectations(sc){
{
Deencapsulation.invoke(sc, "getBatchIdsByMotivation", motivation, "021H");
Set<String> result = new HashSet<String>();
result.add("593406263");
result.add("8603");
result.add("8703");
returns (result);
}
};
*/