i was taking the code of cake walk for a soldier game / count the last days at military.
At the beginning it was working fine. Than I thought it will be good idea, if I ask the soldier for his name and provide the name with the day-counter.
const year = sessionAttributes.hasOwnProperty('year') ? sessionAttributes.year : 0; const month = sessionAttributes.hasOwnProperty('month') ? sessionAttributes.month : 0; const day = sessionAttributes.hasOwnProperty('day') ? sessionAttributes.day : 0; // const firstname = sessionAttributes.hasOwnProperty('firstname') ? sessionAttributes.firstname : 0;
It is saving the name, but the calculation is not longer working, now I get always NaN.
But firstname is not relevant for the Intent HasBirthdayLaunchRequestHandler.
After the NaN error I was deleting the lines around firstname, but the code does not work again. Always the same error NaN. On S3 I deleted the file and so on.
First question: Why can I not save the name similar to the year?
Second question: Why the code does not working after deleting and what impact has saving firstname to the calculation?
Thanks for your help,