Example 1 — Read document.timeline
Confirm the default timeline object type.
const tl = document.timeline;
console.log(tl.constructor.name); // "DocumentTimeline"
console.log(tl === document.timeline); // true How It Works
- Read the getter. Returns the document’s default timeline.
- Check the type. Constructor name is usually
DocumentTimeline. - Same instance. Repeated reads return the same object.
- Do not assign. The property is read-only.

