Why am i getting empty result when i apply a condition to skip array value whose key is even number : Am trying to print an array value at random which worked fine. but when i apply a condition to skip array whose keys are odd (not even) i sometime get a result that display nothing, dunno why. please need help.

Here is the code:

    var arr = [0,1,2,3,4,5];
    var rand = Math.floor(Math.random() * arr.length)
    if(rand % 2 !== 0)
      console.log(arr[rand]);
	