如何确定value变量的 是否是objectusing switch?
var alice = condition ? true : {};
switch(alice){
case true: break;
case undefined: break;
// Is there something like:
case object: break;
}
我目前正在通过附加if语句解决上述问题(除了我现有switch的已经很大并且能够处理和之类的值undefined)true。所以我想知道是否有任何方法可以仅使用现有的switch(alice).