I have a object with printout from a console.log() command:
console.log("event in validation ", this.event_info);
Here is the printout:
event in validation {"start_datetime":"Sun Jul 14 2019 18:20:00 GMT-0700 (PDT)","finish_datetime":"Mon Jul 15 2019 18:20:00 GMT-0700 (PDT)"}
There are 2 fields in this.event_info
: start_datetime
and finish_datetime
. I need to refer the value of finish_datetime
and did the following:
this.event_info["finish_datetime"];
and
let sd = "finish_datetime";
this.event_info[sd];
But there are nothing retrieved (undefined or nothing). Then I tried to print out the keys of the object:
Object.keys(this.event_info);
And printout is:
[ '0',
'1',
'2',
'3',
.
.
.
99
Then I tried these:
this.event_info["1"];
and:
this.event_info[1];
It is nothing printed out again. What is the right way here to refer the value of finish_datetime
?