I am trying to add 3 days to the date I get from the jQuery Datepicker as a variable as I show in this example:
var dateSelected = fromDateInput.datepicker('getDate');
var count = 3;
var lol = dateSelected.setDate(dateSelected.getDate() + count);
console.log(lol);
If I use the variable I will get this in the console for example: 1449615600000.
If I do it like this:
var dateSelected = fromDateInput.datepicker('getDate');
var count = 3;
dateSelected.setDate(dateSelected.getDate() + count);
console.log(dateSelected);
I will get the correct date (The date I select in the datepicker + 3 days)
Why can't I use it in a variable?