jdoc
This variable is a proxy of Factory::getDocument(). It allows to access the active document inside twig layouts.
Returns
\Joomla\CMS\Document\Document
The active document.
Examples
{# Load a script in this page from a twig layout #}
{% do jdoc.addScriptDeclaration('alert("Hello world!")') %}