Don't think that's a good idea if there is 0 elements in the array. That would result in random value between -1 - -1 or 0 - 0 which would pick a invalid index that is out of bounds.