I am using
console.log(p);
console.log(p.datestrshow);
However the output in the console is

Why is it undefined when it is clearly not?
doing
for(i in p)
console.log(i+': ', (typeof p[i] == 'function' ? 'function' : p[i]));
results in 
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
console.logdoesn’t make a clone of yourpobject when you call it.What’s happening is that
p.datestrshowis indeed undefined when youconsole.log, but by the time you expand thepobject in the console, it has been defined, and the console is showing the current state of thepobject withdatestrshowdefined.Here’s a test you can do in the console:
Run this code in the console, then expand the object that was logged. Even though we clearly defined
bafter theconsole.log, it still shows up when you expand the object.