// smash() 函数是在该代码的其他地方定义的。
if (newShip)
smash(champagneBottle,bow); // Boolean 测试,看 newShip 是否为真。
// 在本示例中,除非两个条件都为真,否则该测试将不会被满足。
if (rind.color == "deep yellow " && rind.texture == "large and small wrinkles")
{
theResponse = ("Is it a Crenshaw melon? <br> ");
}
// 在本示例中,只要任何一个条件为真,则测试即会满足。
var theReaction = "";
if ((lbsWeight > 15) || (lbsWeight > 45))
{
theReaction = ("Oh, what a cute kitty! <br>");
}
else
theReaction = ("That's one huge cat you've got there! <br>");