Array shuffle

fncShuffle = function () { 
    return Math.floor(Math.random()*3)-1; 


I have used functions like this in the past to shuffle arrays and in most files it has worked fine. However occasionally(and only in certain files), i have noticed it returning some negative array indices which has lead to errors when looping through the array in the usual way.
I know there are other more consistant methods of shuffling but has anyone else noticed this problem or know why it may occur.