I wrote this piece of code, why doesn't the first function return the value of the second one when I put it (consolePlay()) in the console?
function computerPlay() {
getRandomIntInclusive(1, 3)
}
function getRandomIntInclusive(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min)
}
Your function isn't returning anything. Simply add the return keyword and it will work as expected
function computerPlay() {
return getRandomIntInclusive(1, 3)
}