Wraps number within the inclusive range specified by start and end.
number
start
end
The number to wrap.
The start of the range.
The end of the range.
Returns the wrapped number.
wrap(5, 0, 10)// => 5wrap(15, 0, 10)// => 5wrap(-5, 0, 10)// => 5 Copy
wrap(5, 0, 10)// => 5wrap(15, 0, 10)// => 5wrap(-5, 0, 10)// => 5
Wraps
number
within the inclusive range specified bystart
andend
.