I am trying to call the random number generated and set conditionals to the random number, but I don't know how to call it! Can someone please help?
// This is the random number generator
$(document).ready(function() {
var minNumber = 0;
var maxNumber = 9;
var randomValue = function(){
return Math.floor(Math.random() * maxNumber);
}
$("#random-number").html(randomValue().toString());
// I need to return this value to the "myGuess class and print it on the screen"
console.log(randomValue().toString());
});
// This ends the random number generator
// If you click a number and it equals the random number
$(".number").on("click", function(){
var value = $(this).val();
if($(".guessesLeftVar").text() === function.randomValue){
$(".winCount").text($(".winCount").text()+value);
}
else if($(".guessesLeftVar").text() != function.randomValue){
$(".lossCount").text($(".lossCount").text()+value);
}
});