Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
49
rated 0 times [  51] [ 2]  / answers: 1 / hits: 16910  / 14 Years ago, fri, september 10, 2010, 12:00:00
var one = 1415;
var two = 2343;
var three = 11;


How to get the biggest number from these variables?


More From » jquery

 Answers
6

If you have them in an array, you can do this:



var numbers_array = [1415, 2343, 11];

numbers_array.push( 432 ); // now the array is [1415, 2343, 11, 432]

var biggest = Math.max.apply( null, numbers_array );

[#95662] Tuesday, September 7, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
isaac

Total Points: 645
Total Questions: 109
Total Answers: 96

Location: Cayman Islands
Member since Fri, Mar 4, 2022
2 Years ago
;