I am very new to javascript and I was making a rock, paper, scissor game, but the below lines of code is giving me undefined value can someone explain me in simple words why console log is giving me undefined as output .
let userval = prompt("enter R,P,S");
const object={
R : "ROCK",
P : "PAPER",
S : "SCISSOR"
};
console.log(object.userval)
I want the console to log "ROCK" when i enter R in prompt and so on.