1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| $.fn.extend({ min: function(a, b) { if (a > b) { return b; } else { return a; } }, max: function(a, b) { if (a > b) { return a; } else { return b; } } }); console.log($(window).min(2, 5)); console.log($(window).max(2, 5));
|