📜  Javascript 如何比较三个数字 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:16.743000             🧑  作者: Mango

代码示例1
function compare(num1, num2, num3) {
    if (num3 > num2 && num1 > num3) {
        return num1 + ' is the biggest number';
    } else if (num2 > num1 && num2 > num3) {
        return num2 + ' is the biggest number';
    } else {
        return num3 + ' is the biggest number';
    }
}
var results = compare(10, 20, 30);
console.log(results);