showCase(new String('A'));

来源:互联网 发布:亚马逊德国站情况知乎 编辑:程序博客网 时间:2024/05/21 06:11

value为一个对象

<!DOCTYPE html><html><head></head><body><script>function showCase(value){  debugger;  switch(value){    case 'A':    console.log(' Case A');    break;     case 'B':    console.log(' Case B');    break;     case undefined:    console.log(' undefined');    break;     default:    console.log('do not know');  }}showCase(new String('A'));</script></body></html>

运行结果:

do not know
原创粉丝点击