Java unexpected NaN? : So I have to make some code that, when the user types in a number from 1-4, it will do either + - * or /, depending on what number they choose.

    console.log("Calculator program"); 	    	  	  	     	      	  	
    console.log("1. Add numbers");
    console.log("2. Subtract numbers");
    console.log("3. Multiply numbers");
    console.log("4. Divide numbers");
    
    var choice = prompt ("What is your choice?");
    
    if (choice == 1)
    {
      console.log(number1 + number2);
    }
    if (choice == 2)
    {
      console.log(number1 - number2);
    }
    if (choice == 3)
    {
      console.log(number1 * number2);
    }
    if (choice == 4)
    {
      console.log(number1 / number2);
    }
    
    
    var number1 = prompt("Type in a number"); 
    var number2 = prompt("Type in another number");

The user is meant to put the numbers in after they have chosen a function, however when the user types in the first number, a NaN appears.

I assume this is because the user has not even types in the 2 numbers, but I need the user to type the numbers last.

Any help and advice would be very appreciated, thanks