if (oTest != '#ff0000') { //do something}if (oTest != null) { //do something}if (oTest != false) { //do something}// 虽然这些都正确,但用逻辑非操作符来操作也有同样的效果:if (!oTest) { //do something}