0

When I try to get the page load time using PerformanceEntry I'm able to get an array of data but how do i get only the value of "domComplete" or "duration" instead of the whole list of data; Here's the code:

const time = performance.getEntriesByType("navigation");
console.log(time[0]);
console.log(time[0]['domComplete']);

when i console log (time[0]), this is what i get:

enter image description here

but when using (time[0]['domComplete']) or (time[0]['duration']), it returns 0

enter image description here

1 Answers1

-2

Try this

console.log(time[0].domComplete);
KayKoder
  • 319
  • 1
  • 8