I am a newbie to javascript, and what I am trying to do is this: The webpage prompts you with "how many nights will you be staying?" you put in a number and it is supposed to look something like this "Total cost for checking in [today date] and checking our [nights staying] cost $"
I can't get the date to display the [nights stayed] if just gives random dates not x days from today. here is an example of what is displayed if i enter 5 in the prompt "Total cost for checking in Thu Sep 24 2020 and checking out Wed Jan 01 0245 is $500" not even a real year, nor is it 5 days from today.
var totalnights = prompt('How many nights will you be staying?');
var today;
var costMsg;
var nights;
function TotalCost(today) {
nights = new Date(new Date().getDate()+(totalnights));
nights = (nights.toDateString());
today = new Date()
today = (today.toDateString());
var Msg = 'Total cost for checking in ' + today + ' and checking out ' + nights + ' is ' + '$' + hotel.roomRate * totalnights ;
return Msg;
}