I'm learning programming starting with Javascript, and my instructor had us doing a random dice roll, a simple Math.ceil(6\*Math.random())

I was trying to slightly gameify it and judge the result. So, if you roll a 7, you win, any other roll you lose. The ultimate result would be, 

"You rolled a: 7
You win!"

However, I attempt to accomplish by saying approximately:

```
console.log("You rolled a: " + diceSum);
if (dicesum() == 7) {
console.log("You win!");
} else {
console.log("Aw... you lose.  Better luck next time");

```

}

diceSum() function evaluates each time, so I may get "You rolled a: 7" and "Aw... you lose" because the first roll was a 7, but by the time the if statement came in, the diceSum was something different. 

How do I generate a random number like a dice roll and then reuse its value over and over?

Here's my current code (there is far more than necessary because I'm trying to display the values so I know if it is returning the correct answer):

```
//Functions
//Generate a random single roll of a dice
var getDieRoll = function() {
    return Math.ceil(6*Math.random());
};

//Sum up two dice rolls
var diceSum = function() {
   var firstDie = getDieRoll();
   var secondDie = getDieRoll();
   return firstDie+secondDie;
};
//

//Variables
//Check to see if total sum of the roll is 7
var winMsg = "Winner!"
var loseMsg = "Aw... you lose.  Better luck next time."
//

//Outputs
//show total sum to compare with message below
console.log(diceSum())

//Return a message stating the result
console.log("You rolled a " + diceSum())

//View true false status to compare with message returned below
console.log(diceSum()==7)

//If diceSum is a 7, give winning message, otherwise give losing message
if (diceSum()==7){ 
console.log(winMsg);
 } else {
console.log(loseMsg);
}

```