JS Built-ins
performanceadvanced

performance β€” clearMarks removes entries

πŸ“– Usage Example
performance.getEntries().forEach(e => console.log(e.name, e.duration))

getEntries() returns all recorded performance entries for inspection.

performance.clearMarks()

performance.clearMarks(name) removes all entries with the given name. After clearing, getEntriesByName returns an empty array.

Challenge: Verify that clearMarks removes the named entry.

πŸ’‘ Hints (1)
  • β€’ clearMarks() with no argument clears all marks; with a name, only that name is cleared