Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
非常简单的javascript问题。
我有两个价值观value1 = 20和value2 = 30
value1 = 20
value2 = 30
如何将bigger_number具有较高数字的值分配给变量?
bigger_number
var bigger_number = Math.max(value1, value2);
一点谷歌搜索给出了Math.max的参考
例如:
Math.max([value1[,value2[, ...]]])