Why is ‘undefined’ returned when comparing an function argument to a string from a function?

While there aren’t errors in my code, hopefully there isn’t, whatever I try to do something, or try to understand based on the way I’ve been taught so far, I can’t really proceed any further. Let me explain by showing my code.

function cpuPlay(){
    let numberGen = Math.floor(Math.random() * 3)

  if (numberGen === 0){
    return 'rock'
  }
  if (numberGen === 1){
    return 'paper'
  }
  if (numberGen === 2){
    return 'scissors'
  }
}
// cpuPlay()

function rps(playersChoice){
  if(playersChoice == 'paper' && cpuPlay() == 'rock'){
    console.log('rock')
  } else if (playersChoice == 'paper' && cpuPlay() == 'paper'){
    console.log('paper')
  } else if (playersChoice == 'paper' &&  cpuPlay() == 'scissors'){
    console.log('scissors');
  }
}
rps('paper')

I created cpuPlay to call either rock, paper, or scissors, whenever a random number between 0-2 is called, this function works properly, but rps() is the function that I can’t seem to build properly after 3 days of doing this. No matter how I build this, it seems I keep on getting one of four answers when I call rps(), the answers I get are either ‘rock’,’paper’,’scissors’,’undefined’. Before I thought it was because I used, .toLowerCase() on playerChoice but either way, this function has been giving the same results, if you keep on running rps(‘paper’), it’s eventually show. I’m not sure how I should go any further with this problem, or maybe I’m not supposed to be able to compare, I don’t even know anymore.