Just saw the code below for generating a random number with a range. But I don't quite understand the part that uses |. What does that do? How does that affect an integer return vs a normal floating number?
function rand(min, max, integer) {
var r = Math.random() * (max - min) + min;
return integer ? r|0 : r;
}