I am having the strangest problem with javascript objects. I have a function that is an event handler that looks like this:
.on(some-event, function(event){
console.log(event);
console.log(event.bytesLoaded);
console.log(event.duration);
console.log(JSON.stringify(event));
})
The chrome debuggger shows the first line as this:
bytesLoaded:4575118
bytesTotal:4575118
delayLoadingTime:1503675333159
duration:4.004
The second line as:
NaN
The third line as:
4.004
And the fourth line as:
{"bytesLoaded":null,"bytesTotal":null,"delayLoadingTime":1503675822834,"duration":4.004}
Does anybody know why this strange behavior is happening? Is the chrome debugger lying about seeing an actual number in that field? The duration field works fine in both the debugger and being accessed through javascript.