Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
oatkiller edited this page Sep 13, 2010 · 2 revisions

pass bound an interesting number followed by a lower bound and an upper bound. bound returns the first number unless its lower than the second number, in which case it returns the second number, or unless is higher than the third number, in which case it returns the third number.

(function () {

var a_number_from_one_to_10 = o.bound(11,1,10), // 10
another_number_from_one_to_10 = o.bound(-5,1,10); // 1

o.bound(2,3,5); // 3
o.bound(3,3,5); // 3
o.bound(4,3,5); // 4
o.bound(5,3,5); // 5
o.bound(6,3,5); // 5

})();
Clone this wiki locally